portal all modals to prevent z-index scoping issues

This commit is contained in:
timothycarambat 2024-06-10 16:25:35 -07:00
parent 2961723a30
commit 25b1d69e63

View File

@ -1,9 +1,12 @@
import { createPortal } from "react-dom";
export default function ModalWrapper({ children, isOpen }) { export default function ModalWrapper({ children, isOpen }) {
if (!isOpen) return null; if (!isOpen) return null;
return ( return createPortal(
<div className="bg-black/60 backdrop-blur-sm fixed top-0 left-0 outline-none w-screen h-screen flex items-center justify-center z-30"> <div className="bg-black/60 backdrop-blur-sm fixed top-0 left-0 outline-none w-screen h-screen flex items-center justify-center z-30">
{children} {children}
</div> </div>,
document.getElementById("root")
); );
} }