2022-05-25 18:35:20 +02:00
|
|
|
import { useRouter } from 'next/router'
|
2022-12-24 18:16:09 +01:00
|
|
|
import Aside from 'site/components/navigation/aside'
|
2022-05-25 18:35:20 +02:00
|
|
|
|
2022-12-26 14:31:50 +01:00
|
|
|
const DefaultLayout = ({ app, title = false, children = [] }) => {
|
2022-05-25 18:35:20 +02:00
|
|
|
const router = useRouter()
|
|
|
|
const slug = router.asPath.slice(1)
|
|
|
|
|
|
|
|
return (
|
2022-12-24 18:16:09 +01:00
|
|
|
<div className="m-auto flex flex-row justify-start">
|
|
|
|
<section
|
|
|
|
className={`
|
2022-12-26 14:22:46 +01:00
|
|
|
w-0 lg:w-1/3 flex flex-row justify-end
|
2022-12-24 18:16:09 +01:00
|
|
|
border-0 py-20
|
2022-12-25 19:10:21 +01:00
|
|
|
md:px-4
|
2022-12-24 18:16:09 +01:00
|
|
|
bg-base-200
|
2022-12-25 19:10:21 +01:00
|
|
|
shrink-0
|
2022-12-24 18:16:09 +01:00
|
|
|
md:border-r md:border-base-300
|
2022-12-26 14:22:46 +01:00
|
|
|
lg:block
|
2022-12-24 18:16:09 +01:00
|
|
|
`}
|
|
|
|
>
|
|
|
|
<Aside app={app} slug={slug} />
|
|
|
|
</section>
|
2022-12-25 19:10:21 +01:00
|
|
|
<section className="py-8 lg:py-16 px-6 xl:pl-8 2xl:pl-16">
|
2022-05-25 18:35:20 +02:00
|
|
|
<div>
|
2022-12-25 19:10:21 +01:00
|
|
|
{title && <h1>{title}</h1>}
|
2022-05-25 18:35:20 +02:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default DefaultLayout
|