From 1b34f85f0e3188861c6804666f02b4495cab033c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 14 Feb 2022 15:48:34 +0100 Subject: chore: improve comment form user experience --- src/components/Comment/Comment.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/components/Comment') diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx index ab1dffc..a263771 100644 --- a/src/components/Comment/Comment.tsx +++ b/src/components/Comment/Comment.tsx @@ -24,7 +24,7 @@ const Comment = ({ const intl = useIntl(); const router = useRouter(); const locale = router.locale ? router.locale : settings.locales.defaultLocale; - const [isReply, setIsReply] = useState(false); + const [shouldOpenForm, setShouldOpenForm] = useState(false); const firstFieldRef = useRef(null); useEffect(() => { @@ -98,21 +98,25 @@ const Comment = ({ > {!isNested && (
-
)} - {isReply && ( + {shouldOpenForm && ( )} {comment.replies.length > 0 && ( -- cgit v1.2.3