From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 29 Jan 2022 18:21:37 +0100 Subject: chore: replace lingui functions with react-intl --- src/components/CommentForm/CommentForm.tsx | 45 ++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'src/components/CommentForm') diff --git a/src/components/CommentForm/CommentForm.tsx b/src/components/CommentForm/CommentForm.tsx index 1ed219c..0ea3276 100644 --- a/src/components/CommentForm/CommentForm.tsx +++ b/src/components/CommentForm/CommentForm.tsx @@ -1,9 +1,9 @@ import { ButtonSubmit } from '@components/Buttons'; import { Form, FormItem, Input, TextArea } from '@components/Form'; import Notice from '@components/Notice/Notice'; -import { t } from '@lingui/macro'; import { createComment } from '@services/graphql/mutations'; import { ForwardedRef, forwardRef, useState } from 'react'; +import { useIntl } from 'react-intl'; import styles from './CommentForm.module.scss'; const CommentForm = ( @@ -18,6 +18,7 @@ const CommentForm = ( }, ref: ForwardedRef ) => { + const intl = useIntl(); const [name, setName] = useState(''); const [email, setEmail] = useState(''); const [website, setWebsite] = useState(''); @@ -68,7 +69,12 @@ const CommentForm = ( return (
-

{t`Leave a comment`}

+

+ {intl.formatMessage({ + defaultMessage: 'Leave a comment', + description: 'CommentForm: form title', + })} +

@@ -107,17 +122,31 @@ const CommentForm = (