This commit is contained in:
2024-06-06 18:15:30 +05:00
parent 63fea5da4b
commit 4a75925f86
59 changed files with 2733 additions and 5840 deletions
+14 -12
View File
@@ -24,19 +24,21 @@ function ModalContainer({ className }: ModalContainerProps) {
return () => document.removeEventListener("keydown", handleKeyDown);
}, []);
return (
<div
onClick={() => setModal(null)}
className={[
"absolute w-full min-h-screen top-0 left-0 flex flex-col justify-center items-center p-8 bg-black bg-opacity-75 transition-opacity cursor-pointer",
className,
].join(" ")}
>
<div onClick={(e) => e.stopPropagation()} className="cursor-default">
{modal}
if (modal) {
return (
<div
onClick={() => setModal(null)}
className={[
"absolute w-full min-h-screen top-0 left-0 flex flex-col justify-center items-center p-8 bg-black bg-opacity-75 transition-opacity cursor-pointer z-10",
className,
].join(" ")}
>
<div onClick={(e) => e.stopPropagation()} className="cursor-default">
{modal}
</div>
</div>
</div>
);
);
}
}
export default ModalContainer;