AccountModerationModal: add account preview

This commit is contained in:
Alex Gleason 2022-09-11 12:33:33 -05:00
parent 1e3a959c1c
commit d653c451b6
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,8 +1,9 @@
import React from 'react';
import { FormattedMessage } from 'react-intl';
import Account from 'soapbox/components/account';
import MissingIndicator from 'soapbox/components/missing_indicator';
import { Button, HStack, Modal } from 'soapbox/components/ui';
import { Button, HStack, Modal, Stack } from 'soapbox/components/ui';
import { useAppSelector, useFeatures } from 'soapbox/hooks';
import { makeGetAccount } from 'soapbox/selectors';
@ -39,13 +40,24 @@ const AccountModerationModal: React.FC<IAccountModerationModal> = ({ onClose, ac
title={<FormattedMessage id='account_moderation_modal.title' defaultMessage='Moderate @{acct}' values={{ acct: account.acct }} />}
onClose={handleClose}
>
{features.adminFE && (
<HStack justifyContent='center'>
<Button icon={require('@tabler/icons/external-link.svg')} size='sm' theme='secondary' onClick={handleAdminFE}>
<FormattedMessage id='account_moderation_modal.admin_fe' defaultMessage='Open in AdminFE' />
</Button>
</HStack>
)}
<Stack space={4}>
<div className='p-4 rounded-lg border border-solid border-gray-300 dark:border-gray-800'>
<Account
account={account}
showProfileHoverCard={false}
withLinkToProfile={false}
hideActions
/>
</div>
{features.adminFE && (
<HStack justifyContent='center'>
<Button icon={require('@tabler/icons/external-link.svg')} size='sm' theme='secondary' onClick={handleAdminFE}>
<FormattedMessage id='account_moderation_modal.admin_fe' defaultMessage='Open in AdminFE' />
</Button>
</HStack>
)}
</Stack>
</Modal>
);
};