diff --git a/frontend/src/components/ui/Modal.tsx b/frontend/src/components/ui/Modal.tsx index bce8601..6e7d1b0 100644 --- a/frontend/src/components/ui/Modal.tsx +++ b/frontend/src/components/ui/Modal.tsx @@ -3,42 +3,42 @@ import type { ReactNode } from "react"; import { createPortal } from "react-dom"; interface ModalProps { - isOpen: boolean; - onClose?: () => void; - children: ReactNode; - "data-testid"?: string; + isOpen: boolean; + onClose?: () => void; + children: ReactNode; + "data-testid"?: string; } export function Modal({ - isOpen, - onClose, - children, - "data-testid": testId, + isOpen, + onClose, + children, + "data-testid": testId, }: ModalProps) { - if (!isOpen) return null; - // render the modal top of all elements and position them to document viewport (/ the main wrapper). - // NOTE: this is recommended approach for modals as it shouldn't be bound to the parent box. - const mainContainer = document.querySelector("main"); - return createPortal( -