AccountModerationModal: allow deactivating and deleting accounts

This commit is contained in:
Alex Gleason 2022-09-11 14:29:14 -05:00
parent b29df50374
commit 5d30a8772d
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -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'