Merge branch 'delete-account-text' into 'develop'
DeleteAccount: Do not show explanation related to federation if not federating See merge request soapbox-pub/soapbox-fe!1439
This commit is contained in:
commit
414abfb448
|
@ -4,12 +4,13 @@ import { defineMessages, useIntl } from 'react-intl';
|
|||
import { deleteAccount } from 'soapbox/actions/security';
|
||||
import snackbar from 'soapbox/actions/snackbar';
|
||||
import { Button, Card, CardBody, CardHeader, CardTitle, Form, FormActions, FormGroup, Input } from 'soapbox/components/ui';
|
||||
import { useAppDispatch } from 'soapbox/hooks';
|
||||
import { useAppDispatch, useFeatures } from 'soapbox/hooks';
|
||||
|
||||
const messages = defineMessages({
|
||||
passwordFieldLabel: { id: 'security.fields.password.label', defaultMessage: 'Password' },
|
||||
deleteHeader: { id: 'security.headers.delete', defaultMessage: 'Delete Account' },
|
||||
deleteText: { id: 'security.text.delete', defaultMessage: 'To delete your account, enter your password then click Delete Account. This is a permanent action that cannot be undone. Your account will be destroyed from this server, and a deletion request will be sent to other servers. It\'s not guaranteed that all servers will purge your account.' },
|
||||
localDeleteText: { id: 'security.text.delete.local', defaultMessage: 'To delete your account, enter your password then click Delete Account. This is a permanent action that cannot be undone.' },
|
||||
deleteSubmit: { id: 'security.submit.delete', defaultMessage: 'Delete Account' },
|
||||
deleteAccountSuccess: { id: 'security.delete_account.success', defaultMessage: 'Account successfully deleted.' },
|
||||
deleteAccountFail: { id: 'security.delete_account.fail', defaultMessage: 'Account deletion failed.' },
|
||||
|
@ -18,6 +19,7 @@ const messages = defineMessages({
|
|||
const DeleteAccount = () => {
|
||||
const intl = useIntl();
|
||||
const dispatch = useAppDispatch();
|
||||
const features = useFeatures();
|
||||
|
||||
const [password, setPassword] = React.useState('');
|
||||
const [isLoading, setLoading] = React.useState(false);
|
||||
|
@ -49,7 +51,7 @@ const DeleteAccount = () => {
|
|||
|
||||
<CardBody>
|
||||
<p className='text-gray-400 mb-4'>
|
||||
{intl.formatMessage(messages.deleteText)}
|
||||
{intl.formatMessage(features.federating ? messages.deleteText : messages.localDeleteText)}
|
||||
</p>
|
||||
|
||||
<Form onSubmit={handleSubmit}>
|
||||
|
|
Loading…
Reference in New Issue