feat(dev): Ported dev site to named exports
This commit is contained in:
parent
595417a23b
commit
db789180b6
22 changed files with 287 additions and 315 deletions
|
@ -1,40 +0,0 @@
|
|||
import { useRouter } from 'next/router'
|
||||
// Shared components
|
||||
import Aside from 'site/components/navigation/aside.js'
|
||||
import ThemePicker from 'shared/components/theme-picker.js'
|
||||
import Breadcrumbs from 'shared/components/breadcrumbs.js'
|
||||
import { getCrumbs } from 'shared/utils'
|
||||
import HomeIcon from 'shared/components/icons/home.js'
|
||||
import Link from 'next/link'
|
||||
|
||||
const DefaultLayout = ({ app, title = false, crumbs = false, children = [] }) => {
|
||||
const router = useRouter()
|
||||
const slug = router.asPath.slice(1)
|
||||
const breadcrumbs = crumbs ? crumbs : getCrumbs(app, slug, title)
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-4 m-auto justify-center place-items-stretch">
|
||||
<Aside
|
||||
app={app}
|
||||
slug={slug}
|
||||
before={[
|
||||
<div className="flex flex-row items-center justify-between border-b mb-4" key="home-key">
|
||||
<Link href="/"><HomeIcon /></Link>
|
||||
<ThemePicker app={app} />
|
||||
</div>,
|
||||
]}
|
||||
/>
|
||||
<section className="col-span-4 lg:col-span-3 py-24 px-4 lg:pl-8 bg-base-50">
|
||||
{title && (
|
||||
<div className="xl:pl-4">
|
||||
<Breadcrumbs title={title} crumbs={breadcrumbs} />
|
||||
<h1 className="break-words">{title}</h1>
|
||||
</div>
|
||||
)}
|
||||
{children}
|
||||
</section>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default DefaultLayout
|
Loading…
Add table
Add a link
Reference in a new issue