diff --git a/apps/web/app/(dashboard)/calendar/page.tsx b/apps/web/app/(dashboard)/calendar/page.tsx index d6dc160..62183af 100644 --- a/apps/web/app/(dashboard)/calendar/page.tsx +++ b/apps/web/app/(dashboard)/calendar/page.tsx @@ -394,7 +394,7 @@ export default function CalendarPage() { ) : ( -
Loading calendar...
diff --git a/apps/web/components/calendar/big-calendar-wrapper.tsx b/apps/web/components/calendar/big-calendar-wrapper.tsx index cc0bc27..8b9d538 100644 --- a/apps/web/components/calendar/big-calendar-wrapper.tsx +++ b/apps/web/components/calendar/big-calendar-wrapper.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useCallback, useMemo, useState, useEffect } from 'react'; +import { useCallback, useMemo } from 'react'; import { Calendar, dateFnsLocalizer, Views } from 'react-big-calendar'; import withDragAndDrop from 'react-big-calendar/lib/addons/dragAndDrop'; import 'react-big-calendar/lib/css/react-big-calendar.css'; @@ -76,11 +76,9 @@ export function BigCalendarWrapper({ onViewChange, }: BigCalendarWrapperProps) { const router = useRouter(); - const [currentView, setCurrentView] = useState(defaultView); - useEffect(() => { - setCurrentView(defaultView); - }, [defaultView]); + + const handleSelectEvent = useCallback( (event: CalendarEvent) => { @@ -107,7 +105,7 @@ export function BigCalendarWrapper({ const handleViewChange = useCallback( (newView: string) => { - setCurrentView(newView); + if (onViewChange) onViewChange(newView); }, [onViewChange] @@ -127,6 +125,7 @@ export function BigCalendarWrapper({ return (