add formatted message to reset website

This commit is contained in:
Francis Cao 2023-05-02 23:44:42 -07:00
parent c41fb5ee1b
commit 5692c0e07d
2 changed files with 11 additions and 2 deletions

View File

@ -158,6 +158,10 @@ export const messages = defineMessages({
id: 'message.team-already-member',
defaultMessage: 'You are already a member of the team.',
},
deleteAccount: {
id: 'message.delete-account',
defaultMessage: 'To delete this account, type {confirmation} in the box below to confirm.',
},
deleteWebsite: {
id: 'message.delete-website',
defaultMessage: 'To delete this website, type {confirmation} in the box below to confirm.',

View File

@ -13,7 +13,7 @@ import useMessages from 'hooks/useMessages';
const CONFIRM_VALUE = 'RESET';
export function WebsiteResetForm({ websiteId, onSave, onClose }) {
const { formatMessage, labels, messages } = useMessages();
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
const { post, useMutation } = useApi();
const { mutate, error } = useMutation(data => post(`/websites/${websiteId}/reset`, data));
@ -28,7 +28,12 @@ export function WebsiteResetForm({ websiteId, onSave, onClose }) {
return (
<Form onSubmit={handleSubmit} error={error}>
<p>{formatMessage(messages.resetWebsite, { confirmation: CONFIRM_VALUE })}</p>
<p>
<FormattedMessage
{...messages.resetWebsite}
values={{ confirmation: <b>{CONFIRM_VALUE}</b> }}
/>
</p>
<FormRow label={formatMessage(labels.confirm)}>
<FormInput name="confirm" rules={{ validate: value => value === CONFIRM_VALUE }}>
<TextField autoComplete="off" />