import React, { useRef } from 'react'; import './BottomSheet.css'; export default function BottomSheet({ visible = false, title = '', onClose, children, footer }) { const startY = useRef(0); return ( <>
{ startY.current = e.clientY; }} onPointerUp={e => { if (startY.current - e.clientY < -80) onClose && onClose(); }} >
{title ?
{title}
: null}
{children}
{footer ?
{footer}
: null}
); }