From 36081edf9f0a887078b90fc4a31615d4fe290878 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Sat, 6 Apr 2024 19:14:57 +0800 Subject: [PATCH] update(comment): Add tumb feature and check empty string when submit. --- public/img/download/logo_android.png | Bin 498 -> 0 bytes public/img/download/logo_apple.png | Bin 544 -> 0 bytes .../icon/{like-active.svg => thumb-active.svg} | 0 public/img/icon/{like.svg => thumb.svg} | 0 src/components/Comment/ButtonBar.tsx | 9 ++++++--- src/components/Comment/Comment.tsx | 1 - src/components/Comment/CommentForm.tsx | 2 +- src/components/Comment/CommentInput.tsx | 2 +- src/components/Comment/CommentItem.tsx | 5 ----- src/components/Comment/CommentSubInput.tsx | 10 ---------- src/components/Comment/CommentSubItem.tsx | 2 +- 11 files changed, 9 insertions(+), 22 deletions(-) delete mode 100644 public/img/download/logo_android.png delete mode 100644 public/img/download/logo_apple.png rename public/img/icon/{like-active.svg => thumb-active.svg} (100%) rename public/img/icon/{like.svg => thumb.svg} (100%) delete mode 100644 src/components/Comment/CommentSubInput.tsx diff --git a/public/img/download/logo_android.png b/public/img/download/logo_android.png deleted file mode 100644 index a6256c0d98ffed9d6b53c31dcb3b17a6227da09b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 498 zcmV77^Mmzc6-*=xY~{Izl=LKy(hGV~FqIG}gFw2#X3L)` zHu`!;vDT48d*1v|d{KN;ob+{VrMb_t>tsFt;@=ed1C4PmCwJ?RP@dvvE4KhUp1^+%+_ zaY|J4>%UF0w-+)`;dA;(ceD+2qBGKy>w#|w30Mx%H;k^O0@9=Frmq4Iuq+$b&0Eh4 opPZTgB&AJWuYJ`f_a%Qw zY=wK}?r|*;1VIo4JrR)+^TceJErx^xo-lj)HJk!C*r}XbUVbx{snB6r^!2Wiw<3)1MW)mDq2h4D?3gu=Cq*lDg^ie$e@oG~Qa?YHx$eT; zm(F)n>A7Y-9RFv6KFE1Luagx6-iqFW8NrHF_w%l8n-rm5#FEeRCG35`g6O7ATaU0H z`MkF_hZVm0Qf%$vNxKHFVJm?rZ2{IBuN^#DZzZ%2@bq5_@cxFi1*EX$y~eZ!e8QG% z(-U~m7T~?e8d!+OK1f?Y0(&vz_CYZ$NIzSNpC2`5svTF8F0?{FVrH&Axk&-;M%=q! zH>AE;>H><}#TVF1VYzLWW_MUV)broBfU)GaixxKM13zdc-P?;*3#}<)F5Ss|2OpsY ze&~!ZuN8+9X3cyd?_BN|);(&uLEa`$xoygW@AIKn1vtf(yJN1Hj9Jw@;5we~3OVjR i6ZfzSK@bGNU-<@U_TY1jkc~b70000 { + setThumbup(!thumbup); const res = await onThumbup(); if (res) setThumbup(!thumbup); }; @@ -51,14 +52,16 @@ export default function ButtonBar({ )} {/* 点赞 */} -
+
{thumbupCount > 0 && ( -
+
{thumbupCount}
)}
diff --git a/src/components/Comment/Comment.tsx b/src/components/Comment/Comment.tsx index 65d0f78..2743b83 100644 --- a/src/components/Comment/Comment.tsx +++ b/src/components/Comment/Comment.tsx @@ -39,7 +39,6 @@ export default function Comment({ journalId, className, totalCommentReply, total // 加载评论 const handleLoadMore = useCallback(async () => { - console.log(commentList.length, totalCommentReplyInt); if (commentList.length >= totalCommentReplyInt) return; if (loading) return; setLoading(true); diff --git a/src/components/Comment/CommentForm.tsx b/src/components/Comment/CommentForm.tsx index e915333..498d81a 100644 --- a/src/components/Comment/CommentForm.tsx +++ b/src/components/Comment/CommentForm.tsx @@ -31,7 +31,7 @@ export default function CommentItem({ onSubmit }: Props) { />