import { useEffect } from "react"; import Hotkeys from "react-hot-keys"; import { useAppLayout } from "contexts/AppLayoutContext"; import { cIf, cJoin } from "helpers/className"; /* * ╭─────────────╮ * ───────────────────────────────────────╯ COMPONENT ╰─────────────────────────────────────────── */ interface Props { onClose: () => void; state: boolean; children: React.ReactNode; fillViewport?: boolean; hideBackground?: boolean; padding?: boolean; } // ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ export const Popup = ({ onClose, state, children, fillViewport, hideBackground = false, padding = true, }: Props): JSX.Element => { const { setMenuGestures } = useAppLayout(); useEffect(() => { setMenuGestures(!state); }, [setMenuGestures, state]); return (
{children}
); };