import { useAppLayout } from "contexts/AppLayoutContext"; import { Immutable } from "helpers/types"; import { Dispatch, SetStateAction, useEffect } from "react"; import Hotkeys from "react-hot-keys"; interface Props { setState: | Dispatch> | Dispatch>; state?: boolean; children: React.ReactNode; fillViewport?: boolean; hideBackground?: boolean; padding?: boolean; } export default function Popup(props: Immutable): JSX.Element { const { setState, state, children, fillViewport, hideBackground, padding = true, } = props; const appLayout = useAppLayout(); useEffect(() => { appLayout.setMenuGestures(!state); // eslint-disable-next-line react-hooks/exhaustive-deps }, [state]); return ( { setState(false); }} >
{ setState(false); }} />
{children}
); }