diff --git a/apps/console/src/pages/organizations/audits/AuditsPage.tsx b/apps/console/src/pages/organizations/audits/AuditsPage.tsx index 1e3ba18ed..5a5ee5c1d 100644 --- a/apps/console/src/pages/organizations/audits/AuditsPage.tsx +++ b/apps/console/src/pages/organizations/audits/AuditsPage.tsx @@ -22,8 +22,7 @@ import { useDialogRef, useToast, } from "@probo/ui"; -import { useCallback, useEffect, useRef, useState } from "react"; -import { createPortal } from "react-dom"; +import { useCallback, useEffect, useRef } from "react"; import { useDropzone } from "react-dropzone"; import { graphql, @@ -190,34 +189,19 @@ export default function AuditsPage(props: Props) { setDroppedFile(null); }; - const [mainEl, setMainEl] = useState(null); - useEffect(() => { - const el = document.querySelector("main"); - if (el) { - el.style.position = "relative"; - setMainEl(el); - } - return () => { - if (el) { - el.style.position = ""; - } - }; - }, []); - return (
- {isDragging && canCreateAudit && mainEl && createPortal( + {isDragging && canCreateAudit && (

{__("Drop a PDF to create an audit with a report")}

-
, - mainEl, +
)}