From a6e15857575c0515214d10f6d0dfe37093514a2e Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Mon, 17 Jun 2024 03:17:15 +0800 Subject: [PATCH] chore: better layer for reclusive comments. --- src/components/comment/CommentItem.astro | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/comment/CommentItem.astro b/src/components/comment/CommentItem.astro index d9f0ed6..4318972 100644 --- a/src/components/comment/CommentItem.astro +++ b/src/components/comment/CommentItem.astro @@ -49,19 +49,21 @@ const { comment, config, depth, pending } = Astro.props; { - comment.children && - (depth === 1 ? ( - - ) : ( - <> - {comment.children.map((childComment) => ( - - ))} - - )) + comment.children && depth === 1 && ( + + ) } +{ + comment.children && depth !== 1 && ( + <> + {comment.children.map((childComment) => ( + + ))} + + ) +}