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