diff --git a/src/components/common/Modal.tsx b/src/components/common/Modal.tsx new file mode 100644 index 0000000..ed64e99 --- /dev/null +++ b/src/components/common/Modal.tsx @@ -0,0 +1,38 @@ +import { AnimatePresence, motion } from "framer-motion"; +import type { FC, ReactNode } from "react"; +import { createPortal } from "react-dom"; + +type ModalProps = { + isOpen: boolean; + onClose: () => void; + children: ReactNode; +}; + +const Modal: FC = ({ isOpen, onClose, children }) => { + return createPortal( + + {isOpen && ( + + e.stopPropagation()} + > + {children} + + + )} + , + document.body, + ); +}; + +export default Modal;