From 396338790fb5e3a5d45d90b59719345e39e95954 Mon Sep 17 00:00:00 2001 From: evaain706 Date: Mon, 4 Aug 2025 18:03:23 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[#140]=20fix:=20=EC=9D=BC=EC=A0=95=EC=88=98?= =?UTF-8?q?=EC=A0=95=EB=A1=9C=EC=A7=81=EC=88=98=EC=A0=95/=ED=9B=84?= =?UTF-8?q?=EA=B8=B0=20=EC=9D=BC=EC=9E=90=20=ED=91=9C=EA=B8=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[id]/components/ReviewSection.tsx | 6 +---- .../[id]/hooks/useEditActivityForm.ts | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx b/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx index 2542280..2d80d20 100644 --- a/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx +++ b/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx @@ -58,11 +58,7 @@ function ReviewSection({ key={review.id} userName={review.user.nickname} avatarSrc={review.user.profileImageUrl} - date={new Date(review.createdAt).toLocaleDateString('ko-KR', { - year: 'numeric', - month: '2-digit', - day: '2-digit', - })} + date={review.createdAt.slice(0, 10).replace(/-/g, '.')} reviewText={review.content} /> )); diff --git a/src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts b/src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts index 945687d..7ed9ba5 100644 --- a/src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts +++ b/src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts @@ -141,10 +141,29 @@ export const useEditActivityForm = () => { } const newSchedules = dates.filter((d) => !d.id); + const scheduleIdsToRemove = originalSchedules .filter((orig) => !dates.some((d) => d.id === orig.id)) - .map((d) => d.id) - .filter((id): id is number => id !== undefined); + .map((d) => d.id!) + .filter(Boolean); + + originalSchedules.forEach((orig) => { + const matched = dates.find((d) => d.id === orig.id); + if ( + matched && + (matched.date !== orig.date || + matched.startTime !== orig.startTime || + matched.endTime !== orig.endTime) + ) { + newSchedules.push({ + date: matched.date, + startTime: matched.startTime, + endTime: matched.endTime, + }); + + scheduleIdsToRemove.push(orig.id!); + } + }); const parsedPrice = parseInt(price, 10); if (isNaN(parsedPrice) || parsedPrice <= 0) { From d27b3a2a75e0a4757963e4c3b933e510f3a3b508 Mon Sep 17 00:00:00 2001 From: evaain706 Date: Mon, 4 Aug 2025 19:08:07 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[#140]=20fix:=20UI=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activities/[id]/components/ReviewSection.tsx | 11 +++++++---- .../myactivity/components/InfoSection.tsx | 1 + src/components/Button.tsx | 2 +- src/components/FloatingBox/BookingButton.tsx | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx b/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx index 2d80d20..51a889c 100644 --- a/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx +++ b/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx @@ -8,6 +8,7 @@ import { useQuery } from '@tanstack/react-query'; import { privateInstance } from '@/apis/privateInstance'; import ReviewTitle from './ReviewTitle'; import useUserStore from '@/stores/authStore'; +import cn from '@/lib/cn'; import ReviewCardSkeleton from './Skeletons/ReviewCardSkeleton'; @@ -67,7 +68,7 @@ function ReviewSection({ if (isLoading) { return (
-
+
{[...Array(3)].map((_, index) => ( @@ -80,7 +81,7 @@ function ReviewSection({ if (!reviewData || reviewData.reviews.length === 0) { return (
-
+
@@ -103,8 +104,10 @@ function ReviewSection({
-
-
{ReviewComponent()}
+
+
+ {ReviewComponent()} +
{!user && (
diff --git a/src/app/(with-header)/myactivity/components/InfoSection.tsx b/src/app/(with-header)/myactivity/components/InfoSection.tsx index 9d73cc4..c507ac6 100644 --- a/src/app/(with-header)/myactivity/components/InfoSection.tsx +++ b/src/app/(with-header)/myactivity/components/InfoSection.tsx @@ -39,6 +39,7 @@ export function InfoSection({ placeholder='제목' className='w-full' value={title} + maxLength={20} onChange={(e) => onTitleChange(e.target.value)} />
diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 02fe680..7cd0b3d 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -45,7 +45,7 @@ export default function Button({ )} {...props} > - {isLoading ? 로딩중... : children} + {isLoading ? ... : children} ); } diff --git a/src/components/FloatingBox/BookingButton.tsx b/src/components/FloatingBox/BookingButton.tsx index af11bf3..3ae771e 100644 --- a/src/components/FloatingBox/BookingButton.tsx +++ b/src/components/FloatingBox/BookingButton.tsx @@ -31,7 +31,7 @@ export default function BookingButton({ {onBooking ? (
-

...

+

요청전송중...

) : ( children