import { useEffect } from 'react' import { useSwipeable } from 'react-swipeable' import { useRouter } from 'next/router' // Layouts components import LayoutWrapper from 'site/components/wrappers/layout' /* This component should wrap all page content */ const PageWrapper = ({ title = 'FIXME: No title set', app = false, layout = false, children = [], }) => { const swipeHandlers = useSwipeable({ onSwipedLeft: () => (app.primaryMenu ? app.setPrimaryMenu(false) : null), onSwipedRight: () => (app.primaryMenu ? null : app.setPrimaryMenu(true)), trackMouse: true, }) const router = useRouter() const slug = router.asPath.slice(1) useEffect(() => app.setSlug(slug), [slug]) const childProps = { app: app, title: title, } const Layout = layout return (