aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ContactForm/ContactForm.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-23 12:29:43 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-23 12:29:43 +0100
commit4e7a96c5a831882463802cdd4f84fe1464969cb0 (patch)
tree528e2766120465bd74e94a8f5d37db7c3cd5a3cc /src/components/ContactForm/ContactForm.tsx
parent3a20d3ef2d6fcb6c77ca5ad6aeaf6179d23ecb3e (diff)
refactor: use formatjs swc plugin
I'm not able to configure SWC plugins in Next.js so to make it works, all translation must have an id.
Diffstat (limited to 'src/components/ContactForm/ContactForm.tsx')
-rw-r--r--src/components/ContactForm/ContactForm.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/ContactForm/ContactForm.tsx b/src/components/ContactForm/ContactForm.tsx
index 48772a0..5af6982 100644
--- a/src/components/ContactForm/ContactForm.tsx
+++ b/src/components/ContactForm/ContactForm.tsx
@@ -34,6 +34,7 @@ const ContactForm = () => {
defaultMessage:
'Warning: mail not sent. Some required fields are empty.',
description: 'ContactForm: missing fields message.',
+ id: 'WpycgB',
})
);
return;
@@ -57,6 +58,7 @@ const ContactForm = () => {
defaultMessage:
'Thanks. Your message was successfully sent. I will answer it as soon as possible.',
description: 'ContactForm: success message',
+ id: 'gQKeF+',
})
);
resetForm();
@@ -64,6 +66,7 @@ const ContactForm = () => {
const errorPrefix = intl.formatMessage({
defaultMessage: 'An error occurred:',
description: 'ContactForm: error message',
+ id: 'pTxT7N',
});
const error = `${errorPrefix} ${mail.message}`;
setStatus('error');
@@ -94,21 +97,25 @@ const ContactForm = () => {
const nameLabelBody = intl.formatMessage({
defaultMessage: 'Name',
description: 'ContactForm: name field label',
+ id: '6ibqFS',
});
const emailLabelBody = intl.formatMessage({
defaultMessage: 'Email',
description: 'ContactForm: email field label',
+ id: 'Vuryko',
});
const subjectLabelBody = intl.formatMessage({
defaultMessage: 'Subject',
description: 'ContactForm: subject field label',
+ id: 'uMURuJ',
});
const messageLabelBody = intl.formatMessage({
defaultMessage: 'Message',
description: 'ContactForm: message field label',
+ id: '0zBQpa',
});
return (
@@ -160,6 +167,7 @@ const ContactForm = () => {
{intl.formatMessage({
defaultMessage: 'Send',
description: 'ContactForm: send button text',
+ id: 'X7n7N2',
})}
</ButtonSubmit>
</FormItem>