From 9bde604a6479697854aa8bd97fb4bb527ad4ad15 Mon Sep 17 00:00:00 2001 From: wynter24 Date: Fri, 3 Jan 2025 17:41:10 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8[Feat]=20=EB=8B=A8=EC=9D=BC=20?= =?UTF-8?q?=EB=AA=A8=EC=9E=84=20=EC=A1=B0=ED=9A=8C=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=EB=90=9C=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?#270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club-details/components/DescriptionSection.tsx | 14 ++++++++++++-- .../club-details/components/HeaderSection.tsx | 7 ++----- src/types/bookclubs.ts | 1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/features/club-details/components/DescriptionSection.tsx b/src/features/club-details/components/DescriptionSection.tsx index 4990b5ef..c0debd34 100644 --- a/src/features/club-details/components/DescriptionSection.tsx +++ b/src/features/club-details/components/DescriptionSection.tsx @@ -1,4 +1,6 @@ +import { formatDateForUI } from '@/lib/utils/formatDateForUI'; import { BookClub } from '@/types/bookclubs'; +import { LocationIcon } from '../../../../public/icons'; function DescriptionSection({ clubInfo }: { clubInfo: BookClub }) { return ( @@ -6,8 +8,16 @@ function DescriptionSection({ clubInfo }: { clubInfo: BookClub }) {

모임 상세 설명

-
-

+

+

+ + {clubInfo.address} +

+

+ 마감 날짜 + {formatDateForUI(clubInfo.endDate, 'KOREAN')} +

+

{clubInfo.description}

diff --git a/src/features/club-details/components/HeaderSection.tsx b/src/features/club-details/components/HeaderSection.tsx index f1e48fa7..6fd0e057 100644 --- a/src/features/club-details/components/HeaderSection.tsx +++ b/src/features/club-details/components/HeaderSection.tsx @@ -66,9 +66,6 @@ function HeaderSection({ clubInfo, idAsNumber }: HeaderSectionProps) { } }, [idAsNumber]); - // TODO: 응답값 추가 후 제거 - const EXAMPLE_IMAGE = '/images/profile.png'; - const handleJoinClick = () => { if (!isLoggedIn) { setIsMember({ @@ -96,7 +93,7 @@ function HeaderSection({ clubInfo, idAsNumber }: HeaderSectionProps) { const defaultCardProps: CardProps = { clubId: clubInfo.id, variant: 'detailedClub', - imageUrl: EXAMPLE_IMAGE, + imageUrl: clubInfo.imageUrl || '/images/defaultBookClub.jpg', imageAlt: '모임 이미지', title: clubInfo.title, location: clubInfo.town || '', @@ -118,7 +115,7 @@ function HeaderSection({ clubInfo, idAsNumber }: HeaderSectionProps) { // TODO: 응답값 추가 후 수정 id: 'host1', name: '호스트', - profileImage: EXAMPLE_IMAGE, + profileImage: '/images/profile.png', }, isHost: false, isParticipant: false, diff --git a/src/types/bookclubs.ts b/src/types/bookclubs.ts index 8a9c97f1..24aa3d6a 100644 --- a/src/types/bookclubs.ts +++ b/src/types/bookclubs.ts @@ -26,6 +26,7 @@ export interface BookClub { memberLimit: number; town: string | null; memberCount: number; + address: string; isLiked: boolean; isInactive: boolean; imageUrl?: string | undefined; From 35bc223915620e90d3c9a9b8e295394f0f56e13e Mon Sep 17 00:00:00 2001 From: wynter24 Date: Fri, 3 Jan 2025 19:15:13 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=A8[Feat]=20=ED=8F=89=EC=A0=90?= =?UTF-8?q?=EB=B3=84=20=EB=A6=AC=EB=B7=B0=20=EA=B0=9C=EA=B0=9C=EC=88=98=20?= =?UTF-8?q?=ED=91=9C=EC=8B=9C=20#270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../club-details/components/ReviewSummary.tsx | 29 +++++++++++++++---- src/features/club-details/types/index.ts | 7 +++++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/src/features/club-details/components/ReviewSummary.tsx b/src/features/club-details/components/ReviewSummary.tsx index 567918b5..5368db57 100644 --- a/src/features/club-details/components/ReviewSummary.tsx +++ b/src/features/club-details/components/ReviewSummary.tsx @@ -3,6 +3,20 @@ import RatingDisplay from '@/components/rating-display/RatingDisplay'; import { ClubReviewResponse } from '../types'; function ReviewSummary({ reviewInfo }: { reviewInfo: ClubReviewResponse }) { + const ratingCounts = (score: number) => { + return reviewInfo.ratingCounts[ + score === 5 + ? 'five' + : score === 4 + ? 'four' + : score === 3 + ? 'three' + : score === 2 + ? 'two' + : 'one' + ]; + }; + return (

@@ -22,13 +36,13 @@ function ReviewSummary({ reviewInfo }: { reviewInfo: ClubReviewResponse }) {

- {Array.from({ length: 5 }).map((_, index) => ( + {[5, 4, 3, 2, 1].map((score) => (
- {5 - index}점 + {score}점
- +
- 2 + + {ratingCounts(score)} +
))}
diff --git a/src/features/club-details/types/index.ts b/src/features/club-details/types/index.ts index 3c8fb57e..1a2121e7 100644 --- a/src/features/club-details/types/index.ts +++ b/src/features/club-details/types/index.ts @@ -2,5 +2,12 @@ import { DetailReview } from '@/types/review'; export interface ClubReviewResponse { averageScore: number; + ratingCounts: { + one: number; + two: number; + three: number; + four: number; + five: number; + }; reviews: DetailReview[]; } From 7cb86bb5c30b9344e007b30ec9b0c9569d7a3315 Mon Sep 17 00:00:00 2001 From: wynter24 Date: Fri, 3 Jan 2025 19:20:52 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=92=84[Design]=20=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=ED=8F=89=EC=A0=90=20=EC=86=8C=EC=88=98=EC=A0=90=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20#270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/rating-display/RatingDisplay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/rating-display/RatingDisplay.tsx b/src/components/rating-display/RatingDisplay.tsx index 4c17483b..be2e3fb2 100644 --- a/src/components/rating-display/RatingDisplay.tsx +++ b/src/components/rating-display/RatingDisplay.tsx @@ -5,7 +5,7 @@ export default function RatingDisplay({ }: { ratingCount: number; }) { - const normalizedRating = Math.min(ratingCount, 5); + const normalizedRating = Math.floor(Math.min(ratingCount, 5)); return (
Date: Fri, 3 Jan 2025 19:23:47 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=92=84[Design]=20=EB=A6=AC=EB=B7=B0?= =?UTF-8?q?=20=EB=82=A0=EC=A7=9C=20UI=20=EB=B3=80=ED=99=98=20#270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/club-details/components/ReviewList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/club-details/components/ReviewList.tsx b/src/features/club-details/components/ReviewList.tsx index 03e44737..4daee8be 100644 --- a/src/features/club-details/components/ReviewList.tsx +++ b/src/features/club-details/components/ReviewList.tsx @@ -5,6 +5,7 @@ import { ClubReviewResponse } from '../types'; import DropDown from '@/components/drop-down/DropDown'; import { DetailClubReviewParams } from '@/api/book-club/types'; import EmptyState from '@/components/common-layout/EmptyState'; +import { formatDateForUI } from '@/lib/utils/formatDateForUI'; function ReviewList({ reviewInfo, @@ -40,7 +41,7 @@ function ReviewList({ userProfile={{ profileImage: review.image || '/images/profile.png', userName: review.userName, - createdAt: review.createdAt, + createdAt: formatDateForUI(review.createdAt, 'DATE_ONLY'), }} /> )) From 21942859154874556cbd712ac273dd1565428273 Mon Sep 17 00:00:00 2001 From: wynter24 Date: Fri, 3 Jan 2025 20:01:06 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B[Fix]=20=EC=B1=85=EB=AA=A8?= =?UTF-8?q?=EC=9E=84=20mockData=20=EB=88=84=EB=9D=BD=20=EC=86=8D=EC=84=B1?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20#270?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mocks/mockDatas.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mocks/mockDatas.ts b/src/mocks/mockDatas.ts index 8af67e60..b3205001 100644 --- a/src/mocks/mockDatas.ts +++ b/src/mocks/mockDatas.ts @@ -20,6 +20,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.5, + address: '', }, { id: 2, @@ -38,6 +39,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'confirmed', reviewScore: 4.8, + address: '', }, { id: 3, @@ -56,6 +58,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'confirmed', reviewScore: 4.2, + address: '', }, { id: 4, @@ -74,6 +77,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.7, + address: '', }, { id: 5, @@ -92,6 +96,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.3, + address: '', }, { id: 6, @@ -110,6 +115,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'confirmed', reviewScore: 4.9, + address: '', }, { id: 7, @@ -128,6 +134,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.4, + address: '', }, { id: 8, @@ -146,6 +153,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'confirmed', reviewScore: 4.6, + address: '', }, { id: 9, @@ -164,6 +172,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.1, + address: '', }, { id: 10, @@ -182,6 +191,7 @@ export const mockBookClubs: BookClub[] = [ isPast: false, clubStatus: 'pending', reviewScore: 4.5, + address: '', }, ];