import { XMarkIcon } from '@heroicons/react/24/outline' import { AnimatePresence, motion } from 'framer-motion' import { useEffect } from 'react' import MobileView from '../../views/MobileView' import DesktopView from '../../views/DesktopView' import ReactDOM from 'react-dom' const transition = { ease: 'linear', duration: 0.2 } const BottomPopup = ({ children, active = false, title, close, className = '' }) => { useEffect(() => { if (active) { document.querySelector('html, body').classList.add('overflow-hidden') } else { document.querySelector('html, body').classList.remove('overflow-hidden') } }, [active]) return ReactDOM.createPortal( <> {active && ( <>
{title}
{close && ( )}
{children}
{title}
{close && ( )}
{children}
)}
, document.querySelector('body') ) } export default BottomPopup