diff --git a/apps/web/src/routes/_app/calendar.tsx b/apps/web/src/routes/_app/calendar.tsx index ec1cf79..a13c644 100644 --- a/apps/web/src/routes/_app/calendar.tsx +++ b/apps/web/src/routes/_app/calendar.tsx @@ -63,13 +63,11 @@ function EventComponent({ event }: { event: CalendarEvent }) { } // Custom toolbar -function CustomToolbar({ date, onNavigate, onView, currentView, label }: any) { +function CustomToolbar({ date, onNavigate, label }: any) { const goToBack = () => onNavigate(Navigate.PREVIOUS); const goToNext = () => onNavigate(Navigate.NEXT); const goToToday = () => onNavigate(Navigate.TODAY); - const viewNames = ["month", "week", "day", "agenda"]; - return (
@@ -84,19 +82,6 @@ function CustomToolbar({ date, onNavigate, onView, currentView, label }: any) { {label}
-
- {viewNames.map((name) => ( - - ))} -
); } @@ -254,127 +239,43 @@ function CalendarPage() { +
+ {["month", "week", "day", "agenda"].map((name) => ( + + ))} +
- {view === "month" && ( - ( - setView(newView)} - /> - ), - }} - views={["month", "week", "work_week", "day", "agenda"]} - step={30} - timeslots={2} - style={{ height: isMobile ? 400 : 600 }} - /> - )} - {view === "week" && ( - ( - setView(newView)} - /> - ), - }} - views={["month", "week", "work_week", "day", "agenda"]} - step={30} - timeslots={2} - style={{ height: isMobile ? 400 : 600 }} - /> - )} - {view === "day" && ( - ( - setView(newView)} - /> - ), - }} - views={["month", "week", "work_week", "day", "agenda"]} - step={30} - timeslots={2} - style={{ height: isMobile ? 400 : 600 }} - /> - )} - {view === "agenda" && ( - ( - setView(newView)} - /> - ), - }} - views={["month", "week", "work_week", "day", "agenda"]} - step={30} - timeslots={2} - style={{ height: isMobile ? 400 : 600 }} - /> - )} + , + }} + views={["month", "week", "work_week", "day", "agenda"]} + step={30} + timeslots={2} + style={{ height: isMobile ? 400 : 600 }} + />
{/* Event detail dialog */}