From f998e0948cebabce6554de445988329bc07fc6f9 Mon Sep 17 00:00:00 2001 From: Alma Date: Sun, 13 Apr 2025 13:59:46 +0200 Subject: [PATCH] calendar 10 --- components/calendar/calendar-client.tsx | 240 +++++++++--------------- 1 file changed, 88 insertions(+), 152 deletions(-) diff --git a/components/calendar/calendar-client.tsx b/components/calendar/calendar-client.tsx index 36cf1e09..a0d44e9e 100644 --- a/components/calendar/calendar-client.tsx +++ b/components/calendar/calendar-client.tsx @@ -592,161 +592,97 @@ export function CalendarClient({ initialCalendars, userId, userProfile }: Calend return (
- + +
+
+ + +
-
-
- -
-
- - -
+ + + handleViewChange("dayGridMonth")} + > + Mois + + handleViewChange("timeGridWeek")} + > + Semaine + + handleViewChange("timeGridDay")} + > + Jour + + + +
- - - handleViewChange("dayGridMonth")} - > - Mois - - handleViewChange("timeGridWeek")} - > - Semaine - - handleViewChange("timeGridDay")} - > - Jour - - - -
- - {loading ? ( -
- - Chargement des événements... -
- ) : ( - - cal.events.map(event => ({ - id: event.id, - title: event.title, - start: event.start, - end: event.end, - allDay: event.isAllDay, - description: event.description, - location: event.location, - calendarId: event.calendarId, - originalEvent: event, - backgroundColor: cal.color, - textColor: '#ffffff', - borderColor: cal.color, - })) - )} - locale={frLocale} - selectable={true} - selectMirror={true} - dayMaxEvents={true} - weekends={true} - select={handleDateSelect} - eventClick={(clickInfo) => { - handleEventClick(clickInfo); - setSelectedEventPreview(clickInfo.event.extendedProps.originalEvent); - }} - height="auto" - aspectRatio={1.8} - /> + {loading ? ( +
+ + Chargement des événements... +
+ ) : ( + + cal.events.map(event => ({ + id: event.id, + title: event.title, + start: event.start, + end: event.end, + allDay: event.isAllDay, + description: event.description, + location: event.location, + calendarId: event.calendarId, + originalEvent: event, + backgroundColor: cal.color, + textColor: '#ffffff', + borderColor: cal.color, + })) )} - -
- -
- {selectedEventPreview ? ( - c.id === selectedEventPreview.calendarId)!} - /> - ) : ( - -
-

Mini-calendrier

- - cal.events.map(event => ({ - id: event.id, - title: event.title, - start: event.start, - end: event.end, - backgroundColor: cal.color, - })) - )} - locale={frLocale} - /> -
-
- )} - - -

Calendriers

-
- {calendars.map((calendar) => ( - - ))} -
-
-
-
+ locale={frLocale} + selectable={true} + selectMirror={true} + dayMaxEvents={true} + weekends={true} + select={handleDateSelect} + eventClick={handleEventClick} + height="auto" + aspectRatio={1.8} + /> + )} +
{/* Calendar dialog */}