mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-04 06:54:27 +01:00
30 lines
787 B
TypeScript
30 lines
787 B
TypeScript
import { motion } from "framer-motion";
|
|
import { ReactElement } from "react";
|
|
|
|
|
|
interface Props {
|
|
onClose: () => void;
|
|
|
|
children: ReactElement
|
|
[key: string]: any;
|
|
}
|
|
|
|
|
|
export default function Modal({ onClose, children, ...props }: Props) {
|
|
return (
|
|
<motion.div
|
|
initial={false}
|
|
animate={{ opacity: 1 }}
|
|
exit={{ opacity: 0 }}
|
|
className='w-screen h-full fixed inset-0 py-32 md:py-64 flex flex-col justify-center items-center overflow-x-hidden overflow-y-hidden no-scrollbar'
|
|
{...props}
|
|
>
|
|
<div
|
|
className="w-screen h-full bg-gray-300 bg-opacity-50 absolute inset-0"
|
|
onClick={onClose}
|
|
></div>
|
|
{children}
|
|
</motion.div>
|
|
)
|
|
}
|