diff --git a/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx b/src/app/(with-header)/activities/[id]/components/ReviewSection.tsx index 2542280..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'; @@ -58,11 +59,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} /> )); @@ -71,7 +68,7 @@ function ReviewSection({ if (isLoading) { return (
-
+
{[...Array(3)].map((_, index) => ( @@ -84,7 +81,7 @@ function ReviewSection({ if (!reviewData || reviewData.reviews.length === 0) { return (
-
+
@@ -107,8 +104,10 @@ function ReviewSection({
-
-
{ReviewComponent()}
+
+
+ {ReviewComponent()} +
{!user && (
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) { 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