From 6131b97ec5e3137b3fbb145f78d56430d4b26e57 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) => ( + + ))} + + ) +}