From 454149b25edee9d12fd5142a6f5d38ae1fda44dc Mon Sep 17 00:00:00 2001 From: MIJUUUUU Date: Mon, 21 Sep 2026 15:17:33 +0900 Subject: [PATCH] =?UTF-8?q?fix(client):=20=EC=9D=BC=EC=A0=95=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=ED=99=95=EC=9D=B8=EC=B0=BD=EC=9D=84=20=EC=95=B1=20?= =?UTF-8?q?UI=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/trip/ScheduleDetail.tsx | 61 +++++++++++++++++++------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/src/components/trip/ScheduleDetail.tsx b/src/components/trip/ScheduleDetail.tsx index 63ef3fa..27f4fa5 100644 --- a/src/components/trip/ScheduleDetail.tsx +++ b/src/components/trip/ScheduleDetail.tsx @@ -156,21 +156,52 @@ export default function ScheduleDetail({ scheduleId }: { scheduleId: string }) { } } - async function handleDelete() { - if (deleting || !window.confirm("이 일정을 삭제할까요?\n삭제한 일정은 복구할 수 없습니다.")) { - return; - } + function handleDelete() { + if (deleting) return; - setDeleting(true); - try { - await deleteSchedule(scheduleId); - toast.success("일정을 삭제했습니다."); - router.replace("/trips"); - router.refresh(); - } catch (cause) { - toast.error(cause instanceof Error ? cause.message : "일정을 삭제하지 못했습니다."); - setDeleting(false); - } + toast.custom( + (toastId) => ( +
+
+

일정을 삭제할까요?

+

삭제하면 되돌릴 수 없어요.

+
+
+ + +
+
+ ), + { duration: Infinity }, + ); } if (error) { @@ -220,7 +251,7 @@ export default function ScheduleDetail({ scheduleId }: { scheduleId: string }) { type="button" aria-label="일정 삭제" disabled={deleting} - onClick={() => void handleDelete()} + onClick={handleDelete} className="grid size-8 shrink-0 place-items-center rounded-full text-zinc-600 hover:bg-red-50 hover:text-red-500 disabled:cursor-wait disabled:opacity-50" >