From bed0c290d7eb6a35151ba00f05dd35d83e11749a Mon Sep 17 00:00:00 2001 From: Kjiw0n Date: Fri, 19 Jul 2024 16:46:23 +0900 Subject: [PATCH] =?UTF-8?q?hotfix:=20develop=20=EC=B6=A9=EB=8F=8C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EA=B3=BC=EC=A0=95=EC=97=90=EC=84=9C?= =?UTF-8?q?=EC=9D=98=20timeBlockId=20=EC=82=AD=EC=A0=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/fullCalendar/FullCalendarBox.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/common/fullCalendar/FullCalendarBox.tsx b/src/components/common/fullCalendar/FullCalendarBox.tsx index 3dada028..1e667573 100644 --- a/src/components/common/fullCalendar/FullCalendarBox.tsx +++ b/src/components/common/fullCalendar/FullCalendarBox.tsx @@ -36,6 +36,8 @@ function FullCalendarBox({ size, selectDate, selectedTarget }: FullCalendarBoxPr const [isModalOpen, setModalOpen] = useState(false); const [top, setTop] = useState(0); const [left, setLeft] = useState(0); + const [modalTaskId, setModalTaskId] = useState(null); + const [modalTimeBlockId, setModalTimeBlockId] = useState(null); const calendarRef = useRef(null); @@ -90,11 +92,20 @@ function FullCalendarBox({ size, selectDate, selectedTarget }: FullCalendarBoxPr const adjustedTop = Math.min(calculatedTop, MODAL.SCREEN_HEIGHT - MODAL.TASK_MODAL_HEIGHT); setTop(adjustedTop); setLeft(rect.left - MODAL.TASK_MODAL_WIDTH + 40); - setModalOpen(true); + + const clickedEvent = info.event.extendedProps; + + if (clickedEvent) { + setModalTaskId(clickedEvent.taskId); + setModalTimeBlockId(clickedEvent.timeBlockId); + setModalOpen(true); + } }; const closeModal = () => { setModalOpen(false); + setModalTaskId(null); + setModalTimeBlockId(null); }; const addEventWhenDragged = (selectInfo: DateSelectArg) => { @@ -217,14 +228,15 @@ function FullCalendarBox({ size, selectDate, selectedTarget }: FullCalendarBoxPr eventDrop={updateEvent} // 기존 이벤트 드래그 수정 핸들러 eventResize={updateEvent} // 기존 이벤트 리사이즈 수정 핸들러 /> - {isModalOpen && ( + {isModalOpen && modalTaskId !== null && modalTimeBlockId !== null && ( )}