chore: rename Dirs

This commit is contained in:
2023-01-20 11:30:04 +00:00
parent ab1efc2e2e
commit 3533f26e4e
90 changed files with 0 additions and 0 deletions

23
src/Element/Modal.tsx Normal file
View File

@ -0,0 +1,23 @@
import "./Modal.css";
import { useEffect } from "react"
import * as React from "react";
export interface ModalProps {
onClose?: () => void,
children: React.ReactNode
}
export default function Modal(props: ModalProps) {
const onClose = props.onClose || (() => { });
useEffect(() => {
document.body.classList.add("scroll-lock");
return () => document.body.classList.remove("scroll-lock");
}, []);
return (
<div className="modal" onClick={(e) => { e.stopPropagation(); onClose(); }}>
{props.children}
</div>
)
}