diff --git a/src/components/App/TimezoneProvider.tsx b/src/components/App/TimezoneProvider.tsx index 46b696e..a67c77a 100644 --- a/src/components/App/TimezoneProvider.tsx +++ b/src/components/App/TimezoneProvider.tsx @@ -1,14 +1,14 @@ import { createContext } from "preact"; import { useContext } from "preact/compat"; import { useState } from "preact/hooks"; -import { SystemZone } from "luxon"; +import { DateTime } from "luxon"; type TTimezoneContext = [string, (tz: string) => void]; const TimezoneContext = createContext(["UTC", () => {}] as TTimezoneContext); export const TimezoneProvider = ({ children }) => { - const [timezone, setTimezone] = useState(SystemZone.name); + const [timezone, setTimezone] = useState(DateTime.now().zoneName); return ( diff --git a/src/components/Modal/index.tsx b/src/components/Modal/index.tsx index 26ab871..c1717b8 100644 --- a/src/components/Modal/index.tsx +++ b/src/components/Modal/index.tsx @@ -1,4 +1,5 @@ import { JSX } from "preact"; +import { createPortal } from "preact/compat"; type Props = { setModalOpen: (open: boolean) => never; @@ -9,7 +10,9 @@ type Props = { }; export const Modal = ({ setModalOpen, title, onSubmit, onSubmitText, children }: Props) => { - return ( + const body = document.querySelector("body"); + + return createPortal( , + body, ); }; diff --git a/src/components/Reminder/Attachment.tsx b/src/components/Reminder/Attachment.tsx index 6c2914b..1e6d48c 100644 --- a/src/components/Reminder/Attachment.tsx +++ b/src/components/Reminder/Attachment.tsx @@ -1,12 +1,39 @@ import { useReminder } from "./ReminderContext"; export const Attachment = () => { - const [{ attachment, attachment_name }, setReminder] = useReminder(); + const [{ attachment_name }, setReminder] = useReminder(); return (