AccountModerationModal: allow deactivating and deleting accounts
This commit is contained in:
parent
b29df50374
commit
5d30a8772d
1 changed files with 21 additions and 0 deletions
|
@ -9,6 +9,7 @@ import {
|
|||
suggestUsers,
|
||||
unsuggestUsers,
|
||||
} from 'soapbox/actions/admin';
|
||||
import { deactivateUserModal, deleteUserModal } from 'soapbox/actions/moderation';
|
||||
import snackbar from 'soapbox/actions/snackbar';
|
||||
import Account from 'soapbox/components/account';
|
||||
import List, { ListItem } from 'soapbox/components/list';
|
||||
|
@ -93,6 +94,14 @@ const AccountModerationModal: React.FC<IAccountModerationModal> = ({ onClose, ac
|
|||
.catch(() => {});
|
||||
};
|
||||
|
||||
const handleDeactivate = () => {
|
||||
dispatch(deactivateUserModal(intl, account.id));
|
||||
};
|
||||
|
||||
const handleDelete = () => {
|
||||
dispatch(deleteUserModal(intl, account.id));
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={<FormattedMessage id='account_moderation_modal.title' defaultMessage='Moderate @{acct}' values={{ acct: account.acct }} />}
|
||||
|
@ -141,6 +150,18 @@ const AccountModerationModal: React.FC<IAccountModerationModal> = ({ onClose, ac
|
|||
)}
|
||||
</List>
|
||||
|
||||
<List>
|
||||
<ListItem
|
||||
label={<FormattedMessage id='account_moderation_modal.fields.deactivate' defaultMessage='Deactivate account' />}
|
||||
onClick={handleDeactivate}
|
||||
/>
|
||||
|
||||
<ListItem
|
||||
label={<FormattedMessage id='account_moderation_modal.fields.delete' defaultMessage='Delete account' />}
|
||||
onClick={handleDelete}
|
||||
/>
|
||||
</List>
|
||||
|
||||
<Text theme='subtle' size='xs'>
|
||||
<FormattedMessage
|
||||
id='account_moderation_modal.info.id'
|
||||
|
|
Loading…
Reference in a new issue