From b1c3331518a8d4e87ba8844faef9ee3ae82f1970 Mon Sep 17 00:00:00 2001 From: Camille Moussu Date: Tue, 26 Aug 2025 16:46:03 +0200 Subject: [PATCH] [#7] added missing complex params to event creation --- src/features/Events/EventDisplay.tsx | 25 +- src/features/Events/EventModal.tsx | 368 ++++++++++++++++----------- src/features/Events/EventRepeat.tsx | 30 +++ 3 files changed, 257 insertions(+), 166 deletions(-) create mode 100644 src/features/Events/EventRepeat.tsx diff --git a/src/features/Events/EventDisplay.tsx b/src/features/Events/EventDisplay.tsx index c93a635..036ecdd 100644 --- a/src/features/Events/EventDisplay.tsx +++ b/src/features/Events/EventDisplay.tsx @@ -40,6 +40,7 @@ import { Calendars } from "../Calendars/CalendarTypes"; import { CalendarEvent } from "./EventsTypes"; import { isValidUrl } from "../../utils/apiUtils"; import { formatLocalDateTime } from "./EventModal"; +import RepeatEvent from "./EventRepeat"; export default function EventDisplayModal({ eventId, @@ -405,23 +406,10 @@ export default function EventDisplayModal({ {/* Extended options */} {showMore && ( <> - - Repetition - - + Alarm @@ -451,6 +439,7 @@ export default function EventDisplayModal({ Class - is Busy + is Busy + setCalendarid(Number(e.target.value)) + } + > + {Object.keys(userPersonnalCalendars).map((calendar, index) => ( + + {userPersonnalCalendars[index].name} + + ))} + + - setTitle(e.target.value)} - size="small" - margin="dense" - /> - - Calendar - - - - { - const newStart = e.target.value; - setStart(newStart); - const newRange = { - ...selectedRange, - start: new Date(newStart), - startStr: newStart, - allDay: allday, - }; - setSelectedRange(newRange); - calendarRef.current?.select(newRange); - }} - size="small" - margin="dense" - InputLabelProps={{ shrink: true }} - /> - { - const newEnd = e.target.value; - setEnd(newEnd); - const newRange = { - ...selectedRange, - end: new Date(newEnd), - endStr: newEnd, - allDay: allday, - }; - setSelectedRange(newRange); - calendarRef.current?.select(newRange); - }} - size="small" - margin="dense" - InputLabelProps={{ shrink: true }} - /> - - setDescription(e.target.value)} - size="small" - margin="dense" - multiline - rows={2} - /> - setLocation(e.target.value)} - size="small" - margin="dense" - /> + { + const newEnd = e.target.value; + setEnd(newEnd); + const newRange = { + ...selectedRange, + end: new Date(newEnd), + endStr: newEnd, + allDay: allday, + }; + setSelectedRange(newRange); + calendarRef.current?.select(newRange); + }} + size="small" + margin="dense" + InputLabelProps={{ shrink: true }} + /> + + setDescription(e.target.value)} + size="small" + margin="dense" + multiline + rows={2} + /> + setLocation(e.target.value)} + size="small" + margin="dense" + /> + {/* Extended options */} + {showMore && ( + <> + + Repetition + + + + + Time Zone + + + + Alarm + + - - Repetition - - - - - Time Zone - - + + Class + + + + + )} + - - - - - + + + + + + + + ); } diff --git a/src/features/Events/EventRepeat.tsx b/src/features/Events/EventRepeat.tsx new file mode 100644 index 0000000..5c2db9f --- /dev/null +++ b/src/features/Events/EventRepeat.tsx @@ -0,0 +1,30 @@ +import { + FormControl, + InputLabel, + Select, + SelectChangeEvent, + MenuItem, +} from "@mui/material"; + +export default function RepeatEvent({ + eventClass, + setEventClass, +}: { + eventClass: string; + setEventClass: React.Dispatch>; +}) { + return ( + + is Busy + + + ); +}