mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-25 02:36:20 +01:00
add formatted message to reset website
This commit is contained in:
parent
c41fb5ee1b
commit
5692c0e07d
@ -158,6 +158,10 @@ export const messages = defineMessages({
|
|||||||
id: 'message.team-already-member',
|
id: 'message.team-already-member',
|
||||||
defaultMessage: 'You are already a member of the team.',
|
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: {
|
deleteWebsite: {
|
||||||
id: 'message.delete-website',
|
id: 'message.delete-website',
|
||||||
defaultMessage: 'To delete this website, type {confirmation} in the box below to confirm.',
|
defaultMessage: 'To delete this website, type {confirmation} in the box below to confirm.',
|
||||||
|
@ -13,7 +13,7 @@ import useMessages from 'hooks/useMessages';
|
|||||||
const CONFIRM_VALUE = 'RESET';
|
const CONFIRM_VALUE = 'RESET';
|
||||||
|
|
||||||
export function WebsiteResetForm({ websiteId, onSave, onClose }) {
|
export function WebsiteResetForm({ websiteId, onSave, onClose }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages, FormattedMessage } = useMessages();
|
||||||
const { post, useMutation } = useApi();
|
const { post, useMutation } = useApi();
|
||||||
const { mutate, error } = useMutation(data => post(`/websites/${websiteId}/reset`, data));
|
const { mutate, error } = useMutation(data => post(`/websites/${websiteId}/reset`, data));
|
||||||
|
|
||||||
@ -28,7 +28,12 @@ export function WebsiteResetForm({ websiteId, onSave, onClose }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={handleSubmit} error={error}>
|
<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)}>
|
<FormRow label={formatMessage(labels.confirm)}>
|
||||||
<FormInput name="confirm" rules={{ validate: value => value === CONFIRM_VALUE }}>
|
<FormInput name="confirm" rules={{ validate: value => value === CONFIRM_VALUE }}>
|
||||||
<TextField autoComplete="off" />
|
<TextField autoComplete="off" />
|
||||||
|
Loading…
Reference in New Issue
Block a user