import { useDisableBodyScrollOnMobile } from '@/Hooks/useDisableBodyScrollOnMobile' import { classNames } from '@standardnotes/snjs' import { ReactNode, useCallback } from 'react' import Portal from '../Portal/Portal' import MobileModalAction from '../Modal/MobileModalAction' import { useModalAnimation } from '../Modal/useModalAnimation' import MobileModalHeader from '../Modal/MobileModalHeader' import { mergeRefs } from '@/Hooks/mergeRefs' import { DialogWithClose } from '@/Utils/CloseOpenModalsAndPopovers' const DisableScroll = () => { useDisableBodyScrollOnMobile() return null } const MobilePopoverContent = ({ open, requestClose, children, title, className, id, }: { open: boolean requestClose: () => void children: ReactNode title: string id: string className?: string }) => { const [isMounted, setPopoverElement] = useModalAnimation(open) const addCloseMethod = useCallback( (element: HTMLDivElement | null) => { if (element) { ;(element as DialogWithClose).close = requestClose } }, [requestClose], ) if (!isMounted) { return null } return (
{title}
Done
{children}
) } export default MobilePopoverContent