diff --git a/app/soapbox/features/admin/components/unapproved_account.js b/app/soapbox/features/admin/components/unapproved_account.js deleted file mode 100644 index 80ca4821d..000000000 --- a/app/soapbox/features/admin/components/unapproved_account.js +++ /dev/null @@ -1,77 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { defineMessages, injectIntl } from 'react-intl'; -import { connect } from 'react-redux'; - -import { approveUsers } from 'soapbox/actions/admin'; -import snackbar from 'soapbox/actions/snackbar'; -import IconButton from 'soapbox/components/icon_button'; -import { makeGetAccount } from 'soapbox/selectors'; - -import { rejectUserModal } from '../../../actions/moderation'; - -const messages = defineMessages({ - approved: { id: 'admin.awaiting_approval.approved_message', defaultMessage: '{acct} was approved!' }, - rejected: { id: 'admin.awaiting_approval.rejected_message', defaultMessage: '{acct} was rejected.' }, -}); - -const makeMapStateToProps = () => { - const getAccount = makeGetAccount(); - - const mapStateToProps = (state, { accountId }) => { - return { - account: getAccount(state, accountId), - }; - }; - - return mapStateToProps; -}; - -export default @connect(makeMapStateToProps) -@injectIntl -class UnapprovedAccount extends ImmutablePureComponent { - - static propTypes = { - intl: PropTypes.object.isRequired, - account: ImmutablePropTypes.record.isRequired, - }; - - handleApprove = () => { - const { dispatch, intl, account } = this.props; - dispatch(approveUsers([account.get('id')])) - .then(() => { - const message = intl.formatMessage(messages.approved, { acct: `@${account.get('acct')}` }); - dispatch(snackbar.success(message)); - }) - .catch(() => {}); - } - - handleReject = () => { - const { dispatch, intl, account } = this.props; - - dispatch(rejectUserModal(intl, account.get('id'), () => { - const message = intl.formatMessage(messages.rejected, { acct: `@${account.get('acct')}` }); - dispatch(snackbar.info(message)); - })); - } - - render() { - const { account } = this.props; - - return ( -
{account.getIn(['pleroma', 'admin', 'registration_reason'])}-
{account.pleroma.getIn(['admin', 'registration_reason'], '') as string}+