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 && ( )}