From 6dbb7f628d2da0f89d556885a0fa16c918a3d6eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=96=B4=EC=8A=B9=EC=A4=80?= Date: Fri, 12 Jan 2024 05:28:12 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=A6=AC=EB=B7=B0/=EB=8C=93=EA=B8=80=20?= =?UTF-8?q?=EB=94=94=EC=9E=90=EC=9D=B8=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailSectionBottom/ReviewItem.tsx | 159 +++++++++--------- src/components/Review/CommentItem.tsx | 10 +- src/components/Review/DetailReview.tsx | 30 ++-- src/components/Review/ReviewComments.tsx | 4 +- 4 files changed, 101 insertions(+), 102 deletions(-) diff --git a/src/components/DetailSectionBottom/ReviewItem.tsx b/src/components/DetailSectionBottom/ReviewItem.tsx index eac39511..4bc2caec 100644 --- a/src/components/DetailSectionBottom/ReviewItem.tsx +++ b/src/components/DetailSectionBottom/ReviewItem.tsx @@ -111,25 +111,25 @@ const Item: React.FC = (props: ItemProps) => { }; return ( - <> -
-
-
- {!( - authorProfileImageUrl === 'http://asiduheimage.jpg' || - authorProfileImageUrl === null - ) ? ( - 유저 프로필 - ) : ( - - )} -
-
-
{authorNickname}
+
+
+
+ {!( + authorProfileImageUrl === 'http://asiduheimage.jpg' || + authorProfileImageUrl === null + ) ? ( + 유저 프로필 + ) : ( + + )} +
+
+
{authorNickname}
+
{Array.from({ length: 5 }, (_, index) => ( = (props: ItemProps) => { /> ))}
+
+ {formatCreatedTime(createdTime)} +
-
- {formatCreatedTime(createdTime)} +
+ + {isAuthor && ( +
openModal('내 리뷰', reviewId, e)}> +
- {isAuthor && ( + )} +
+ {canTextOverflow ? ( +
+ {content.length > 55 ? `${content.slice(0, 55)}...` : content} +
+ ) : ( +
{content}
+ )} + +
+
+ {!showMoreKeywords && + keywords.slice(0, 2).map((keyword, idx) => ( +
+ {getEmoji(keyword.content)} {keyword.content} +
+ ))} + {keywords.length > 2 && !showMoreKeywords && (
openModal('내 리뷰', reviewId, e)}> - + className="rounded-md bg-gray1 px-2 py-1 text-xs text-gray6" + onClick={(e) => { + handleClickPlusButton(e); + }}> + +{keywords.length - 2}
)}
- {canTextOverflow ? ( -
- {content.length > 75 ? `${content.slice(0, 75)}...` : content} -
- ) : ( -
{content}
- )} - -
-
- {!showMoreKeywords && - keywords.slice(0, 2).map((keyword, idx) => ( +
+ {showMoreKeywords && + Array.from({ length: Math.ceil(keywords.length / 2) }).map( + (_, lineIdx) => (
- {getEmoji(keyword.content)} {keyword.content} + key={lineIdx} + className={`flex gap-2 ${ + lineIdx === Math.ceil(keywords.length / 2) - 1 + ? '' + : ' mb-3' + }`}> + {keywords + .slice(lineIdx * 2, lineIdx * 2 + 2) + .map((keyword, idx) => ( +
+ {getEmoji(keyword.content)} {keyword.content} +
+ ))}
- ))} - {keywords.length > 2 && !showMoreKeywords && ( -
{ - handleClickPlusButton(e); - }}> - +{keywords.length - 2} -
+ ), )} -
-
- {showMoreKeywords && - Array.from({ length: Math.ceil(keywords.length / 2) }).map( - (_, lineIdx) => ( -
- {keywords - .slice(lineIdx * 2, lineIdx * 2 + 2) - .map((keyword, idx) => ( -
- {getEmoji(keyword.content)} {keyword.content} -
- ))} -
- ), - )} -
+
-
- -
{commentCount}
-
+
+ +
{commentCount}
- +
); }; diff --git a/src/components/Review/CommentItem.tsx b/src/components/Review/CommentItem.tsx index 7305ed3f..c4e4d264 100644 --- a/src/components/Review/CommentItem.tsx +++ b/src/components/Review/CommentItem.tsx @@ -56,7 +56,7 @@ const CommentItem: React.FC = (props: ItemProps) => { return (
-
+
{!( authorProfileImageUrl === 'http://asiduheimage.jpg' || @@ -65,15 +65,15 @@ const CommentItem: React.FC = (props: ItemProps) => { 유저 프로필 ) : ( - + )}
{authorNickname}
-
+
{formatCreatedTime(createdTime)}
@@ -85,7 +85,7 @@ const CommentItem: React.FC = (props: ItemProps) => {
)}
-
{content}
+
{content}
); }; diff --git a/src/components/Review/DetailReview.tsx b/src/components/Review/DetailReview.tsx index 9e1db449..8d5539e7 100644 --- a/src/components/Review/DetailReview.tsx +++ b/src/components/Review/DetailReview.tsx @@ -8,21 +8,19 @@ export default function DetailReview() { const { item, tourItemId } = state; return ( -
- -
+ ); } diff --git a/src/components/Review/ReviewComments.tsx b/src/components/Review/ReviewComments.tsx index 03ccadd7..8cde28ec 100644 --- a/src/components/Review/ReviewComments.tsx +++ b/src/components/Review/ReviewComments.tsx @@ -63,9 +63,9 @@ export default function ReviewComments() { return ( <> -
+
댓글 - {commentDataLength} + {commentDataLength}
{commentDataLength == 0 && (