From 6562f73871ee2afe4f5f1ed1ba6ef2f59349f65f Mon Sep 17 00:00:00 2001 From: yoonjin-C Date: Tue, 3 Dec 2024 14:16:00 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Feat:=20=ED=95=9C=EC=A4=84?= =?UTF-8?q?=ED=8F=89=EC=97=90=EC=84=9C=20=EC=9C=A0=EC=A0=80=EB=8B=89?= =?UTF-8?q?=EB=84=A4=EC=9E=84=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20=EC=9C=A0?= =?UTF-8?q?=EC=A0=80=20=ED=99=88=EC=9C=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookduck/src/components/BookInfoPage/UserComment.jsx | 11 +++++++++-- bookduck/src/pages/BookInfoPage/UserCommentPage.jsx | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bookduck/src/components/BookInfoPage/UserComment.jsx b/bookduck/src/components/BookInfoPage/UserComment.jsx index ef4d752c..a47dfc02 100644 --- a/bookduck/src/components/BookInfoPage/UserComment.jsx +++ b/bookduck/src/components/BookInfoPage/UserComment.jsx @@ -1,4 +1,5 @@ import { useState } from "react"; +import { useNavigate } from "react-router-dom"; import starNo from "../../assets/bookinfoPage/star-small-no.svg"; import starYes from "../../assets/bookinfoPage/star-small-yes.svg"; import starHalf from "../../assets/bookinfoPage/star-small-half.svg"; @@ -8,6 +9,7 @@ import { enrollLike, deleteLike } from "../../api/bookinfo"; import { getUserId } from "../../api/oauth"; const UserComment = ({ data }) => { + const navigate = useNavigate(); //날짜 포맷 const formattedDate = data?.createdTime.split("T")[0].replace(/-/g, "."); const [isLiked, setIsLiked] = useState(data?.isLiked || false); @@ -30,7 +32,9 @@ const UserComment = ({ data }) => { console.error("좋아요 처리 실패:", error); } }; - + const handleUserClick = (userId) => { + navigate(`/user/${userId}`); + }; return (
@@ -50,7 +54,10 @@ const UserComment = ({ data }) => { {userId === data.userId ? ( 나의 한줄평 ) : ( - + handleUserClick(data?.userId)} + > {data?.userNickname} )} diff --git a/bookduck/src/pages/BookInfoPage/UserCommentPage.jsx b/bookduck/src/pages/BookInfoPage/UserCommentPage.jsx index 2809805b..d6f5b056 100644 --- a/bookduck/src/pages/BookInfoPage/UserCommentPage.jsx +++ b/bookduck/src/pages/BookInfoPage/UserCommentPage.jsx @@ -12,7 +12,7 @@ const UserCommentPage = () => {
{ratingList.length > 0 && ratingList.map((oneLine, index) => ( -
+
From 3f78c86a62f6387949fd503bb20c91deb517d8da Mon Sep 17 00:00:00 2001 From: yoonjin-C Date: Tue, 3 Dec 2024 14:35:52 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20Fix:=20userId=20=EC=A0=84?= =?UTF-8?q?=EB=8B=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookduck/src/components/SearchPage/SearchUserComponent.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/bookduck/src/components/SearchPage/SearchUserComponent.jsx b/bookduck/src/components/SearchPage/SearchUserComponent.jsx index 87eeac23..4e7fd16d 100644 --- a/bookduck/src/components/SearchPage/SearchUserComponent.jsx +++ b/bookduck/src/components/SearchPage/SearchUserComponent.jsx @@ -69,6 +69,7 @@ const SearchUserComponent = ({ search }) => { users.map((user) => (