diff --git a/src/ui/components/EditEvent.css b/src/ui/components/EditEvent.css new file mode 100644 index 0000000..a9a0b10 --- /dev/null +++ b/src/ui/components/EditEvent.css @@ -0,0 +1,7 @@ +.ofc-form-grid { + display: grid; + grid-template-columns: auto 1fr; + gap: 10px; + margin-top: 10px; + align-items: center; +} diff --git a/src/ui/components/EditEvent.tsx b/src/ui/components/EditEvent.tsx index 773a243..20e8253 100644 --- a/src/ui/components/EditEvent.tsx +++ b/src/ui/components/EditEvent.tsx @@ -2,6 +2,7 @@ import { DateTime } from "luxon"; import * as React from "react"; import { useEffect, useRef, useState } from "react"; import { CalendarInfo, OFCEvent } from "../../types"; +import "./EditEvent.css"; function makeChangeListener( setState: React.Dispatch>, @@ -97,7 +98,7 @@ export const EditEvent = ({ defaultCalendarIndex, }: EditEventProps) => { const [date, setDate] = useState( - initialEvent + (initialEvent ? initialEvent.type === "single" ? initialEvent.date : initialEvent.type === "recurring" @@ -105,7 +106,7 @@ export const EditEvent = ({ : initialEvent.type === "rrule" ? initialEvent.startDate : "" - : "" + : "") || "" ); const [endDate, setEndDate] = useState( initialEvent && initialEvent.type === "single" @@ -249,7 +250,9 @@ export const EditEvent = ({

- {!isRecurring && ( + {isRecurring ? ( + <> + ) : ( ) : ( <> + {!isRecurring && " @ "} x )} /> - - + {" - "}

- setAllDay(e.target.checked)} type="checkbox" /> +

- setIsRecurring(e.target.checked)} type="checkbox" /> +

{isRecurring && ( @@ -313,16 +317,15 @@ export const EditEvent = ({ value={daysOfWeek} onChange={setDaysOfWeek} /> -

- Starts recurring +

+
Start:
x)} /> - and stops recurring +
Stop:
x )} /> -

+
)}

- +

{isTask && ( <> - + )}