Skip to content
Snippets Groups Projects
Commit 25b1d69e authored by timothycarambat's avatar timothycarambat
Browse files

portal all modals to prevent z-index scoping issues

parent 2961723a
No related branches found
No related tags found
No related merge requests found
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")
); );
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment