From 1d74723e44a157d97d70b350e804572034174d51 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Wed, 10 Sep 2025 11:45:17 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E4=BC=98=E5=8C=96=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E9=A1=B9=E7=BB=84=E4=BB=B6=E7=9A=84=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=92=8C=E4=BA=A4=E4=BA=92=EF=BC=8C=E5=A2=9E=E5=BC=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/comment/comment-item.tsx | 178 ++++++++++---------- 1 file changed, 90 insertions(+), 88 deletions(-) diff --git a/web/src/components/comment/comment-item.tsx b/web/src/components/comment/comment-item.tsx index ffb537d..1d560b7 100644 --- a/web/src/components/comment/comment-item.tsx +++ b/web/src/components/comment/comment-item.tsx @@ -149,106 +149,108 @@ export function CommentItem( } return ( -
-
- {getGravatarByUser(comment.user)} -
-
-
{comment.user.nickname}
-

- { - isPrivate && - } - { - parentComment && - <>{t("reply")} : - } - {comment.content} -

-
- {new Date(comment.updatedAt).toLocaleString()} - {/* 点赞按钮 */} - : + } + {comment.content} +

+
+ {new Date(comment.updatedAt).toLocaleString()} + {/* 点赞按钮 */} + - {/* 回复按钮 */} - + {/* 回复按钮 */} + - {/* 编辑和删除按钮 仅自己的评论可见 */} - {user?.id === comment.user.id && ( - <> - + {/* 编辑和删除按钮 仅自己的评论可见 */} + {user?.id === comment.user.id && ( + <> + + onClick={() => { setShowEditInput(!showEditInput); setShowReplyInput(false); }} + > + + - + + )} + + {replyCount > 0 && + - - )} - - {replyCount > 0 && - - } -
- {/* 这俩输入框一次只能显示一个 */} - {showReplyInput && !showEditInput && } - {showEditInput && !showReplyInput && } - {showReplies && replies.length > 0 && ( -
- {replies.map((reply) => ( - - ))} + }
- )} -
-
+ {/* 这俩输入框一次只能显示一个 */} + {showReplyInput && !showEditInput && } + {showEditInput && !showReplyInput && } + +
+ + {showReplies && replies.length > 0 && ( +
+ {replies.map((reply) => ( + + ))} +
+ )} ) }