From b1b28fa592dd66bffdd742aa800553fda6fb12d1 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sat, 22 Oct 2022 02:15:13 +0100 Subject: [PATCH] feat: hide reply button for depth 3 --- src/components/common/Comment.tsx | 1 + src/components/common/CommentItem.tsx | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index bfcb1230..a497c5ea 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -27,6 +27,7 @@ export const Comment: React.FC<{ originalId={page?.id} comment={comment} key={comment.transactionHash} + depth={0} /> ))} diff --git a/src/components/common/CommentItem.tsx b/src/components/common/CommentItem.tsx index b1414850..7df0c910 100644 --- a/src/components/common/CommentItem.tsx +++ b/src/components/common/CommentItem.tsx @@ -20,15 +20,15 @@ export const CommentItem: React.FC<{ comment: NoteEntity & { character?: CharacterEntity | null } - isSub?: boolean originalId?: string -}> = ({ comment, isSub, originalId }) => { + depth: number +}> = ({ comment, originalId, depth }) => { const [replyOpen, setReplyOpen] = useState(false) return (
0 ? "" : "border-b border-dashed pb-6"} >
- + {depth < 2 && ( + + )}
{replyOpen && (
@@ -109,7 +111,7 @@ export const CommentItem: React.FC<{ ), )}