From 947830904239d51ec9e94971fed6346c1089911f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 23 Jan 2023 19:01:28 +0100 Subject: chore: make Links and Images compliant with Next.js 13 --- src/components/organisms/layout/comment.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/components/organisms/layout/comment.tsx') diff --git a/src/components/organisms/layout/comment.tsx b/src/components/organisms/layout/comment.tsx index 497a04c..3b58a79 100644 --- a/src/components/organisms/layout/comment.tsx +++ b/src/components/organisms/layout/comment.tsx @@ -5,7 +5,7 @@ import { type SingleComment } from '@ts/types/app'; import useSettings from '@utils/hooks/use-settings'; import Image from 'next/image'; import Script from 'next/script'; -import { FC, useState } from 'react'; +import { FC, useCallback, useState } from 'react'; import { useIntl } from 'react-intl'; import { type Comment as CommentSchema, type WithContext } from 'schema-dts'; import CommentForm, { type CommentFormProps } from '../forms/comment-form'; @@ -42,6 +42,11 @@ const Comment: FC = ({ const { website } = useSettings(); const [isReplying, setIsReplying] = useState(false); + const handleReply = useCallback( + () => setIsReplying((prevState) => !prevState), + [] + ); + if (!approved) { return (
@@ -114,11 +119,11 @@ const Comment: FC = ({ {author.avatar && (
{author.avatar.alt}
)} @@ -149,7 +154,7 @@ const Comment: FC = ({ />