diff --git a/app/soapbox/features/admin/awaiting_approval.js b/app/soapbox/features/admin/awaiting_approval.js index 4486f4b27..94c7284c9 100644 --- a/app/soapbox/features/admin/awaiting_approval.js +++ b/app/soapbox/features/admin/awaiting_approval.js @@ -8,10 +8,13 @@ import Column from '../ui/components/column'; import IconButton from 'soapbox/components/icon_button'; import ScrollableList from 'soapbox/components/scrollable_list'; import { fetchUsers, deleteUsers, approveUsers } from 'soapbox/actions/admin'; +import snackbar from 'soapbox/actions/snackbar'; const messages = defineMessages({ heading: { id: 'column.admin.awaiting_approval', defaultMessage: 'Awaiting Approval' }, emptyMessage: { id: 'admin.awaiting_approval.empty_message', defaultMessage: 'There is nobody waiting for approval. When a new user signs up, you can review them here.' }, + approved: { id: 'admin.awaiting_approval.approved_message', defaultMessage: '{acct} was approved!' }, + rejected: { id: 'admin.awaiting_approval.rejected_message', defaultMessage: '{acct} was rejected.' }, }); const mapStateToProps = state => { @@ -43,16 +46,22 @@ class AwaitingApproval extends ImmutablePureComponent { } handleApprove = nickname => { - const { dispatch } = this.props; + const { dispatch, intl } = this.props; return e => { - dispatch(approveUsers([nickname])); + dispatch(approveUsers([nickname])).then(() => { + const message = intl.formatMessage(messages.approved, { acct: `@${nickname}` }); + dispatch(snackbar.success(message)); + }).catch(() => {}); }; } handleReject = nickname => { - const { dispatch } = this.props; + const { dispatch, intl } = this.props; return e => { - dispatch(deleteUsers([nickname])); + dispatch(deleteUsers([nickname])).then(() => { + const message = intl.formatMessage(messages.rejected, { acct: `@${nickname}` }); + dispatch(snackbar.info(message)); + }).catch(() => {}); }; } @@ -70,8 +79,8 @@ class AwaitingApproval extends ImmutablePureComponent {
{user.get('registration_reason')}