From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sat, 29 Jan 2022 18:21:37 +0100
Subject: chore: replace lingui functions with react-intl

---
 src/components/CommentsList/CommentsList.tsx | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

(limited to 'src/components/CommentsList/CommentsList.tsx')

diff --git a/src/components/CommentsList/CommentsList.tsx b/src/components/CommentsList/CommentsList.tsx
index bdca00b..6630a03 100644
--- a/src/components/CommentsList/CommentsList.tsx
+++ b/src/components/CommentsList/CommentsList.tsx
@@ -1,6 +1,6 @@
-import { Comment as CommentData } from '@ts/types/comments';
 import Comment from '@components/Comment/Comment';
-import { t } from '@lingui/macro';
+import { Comment as CommentData } from '@ts/types/comments';
+import { useIntl } from 'react-intl';
 import styles from './CommentsList.module.scss';
 
 const CommentsList = ({
@@ -10,6 +10,8 @@ const CommentsList = ({
   articleId: number;
   comments: CommentData[];
 }) => {
+  const intl = useIntl();
+
   const getCommentsList = () => {
     return comments.map((comment) => {
       return (
@@ -20,11 +22,21 @@ const CommentsList = ({
 
   return (
     <>
-      <h2 className={styles.title}>{t`Comments`}</h2>
+      <h2 className={styles.title}>
+        {intl.formatMessage({
+          defaultMessage: 'Comments',
+          description: 'CommentsList: Comments section title',
+        })}
+      </h2>
       {comments.length > 0 ? (
         <ol className={styles.list}>{getCommentsList()}</ol>
       ) : (
-        <p className={styles['no-comments']}>{t`No comments yet.`}</p>
+        <p className={styles['no-comments']}>
+          {intl.formatMessage({
+            defaultMessage: 'No comments yet.',
+            description: 'CommentsList: No comment message',
+          })}
+        </p>
       )}
     </>
   );
-- 
cgit v1.2.3

