diff --git a/frontend/src/components/calendar/CalendarPage.tsx b/frontend/src/components/calendar/CalendarPage.tsx index 48d4cfa..67a6099 100644 --- a/frontend/src/components/calendar/CalendarPage.tsx +++ b/frontend/src/components/calendar/CalendarPage.tsx @@ -1,4 +1,4 @@ -import { useState, useRef, useMemo } from 'react'; +import { useState, useRef, useEffect, useMemo } from 'react'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { toast } from 'sonner'; import FullCalendar from '@fullcalendar/react'; @@ -51,6 +51,18 @@ export default function CalendarPage() { const { settings } = useSettings(); const { data: calendars = [] } = useCalendars(); + const calendarContainerRef = useRef(null); + + // Resize FullCalendar when container size changes (e.g. sidebar collapse) + useEffect(() => { + const el = calendarContainerRef.current; + if (!el) return; + const observer = new ResizeObserver(() => { + calendarRef.current?.getApi().updateSize(); + }); + observer.observe(el); + return () => observer.disconnect(); + }, []); const { data: events = [] } = useQuery({ queryKey: ['calendar-events'], @@ -270,7 +282,7 @@ export default function CalendarPage() {
-
+
{/* Custom toolbar — h-16 matches sidebar header */}