1
0
Fork 0

chore(freesewing.dev): Layout composition changes

This commit is contained in:
Joost De Cock 2022-05-11 17:41:24 +02:00
parent 08e395cd58
commit e4a61c6502
8 changed files with 256 additions and 96 deletions

View file

@ -3,6 +3,7 @@ import { useSwipeable } from 'react-swipeable'
import { useRouter } from 'next/router'
import { useHotkeys } from 'react-hotkeys-hook'
// Layouts components
import LayoutWrapper from 'site/components/wrappers/layout'
import Docs from 'site/components/layouts/docs'
const layouts = {
@ -14,7 +15,7 @@ const PageWrapper= ({
title="FIXME: No title set",
noSearch=false,
app=false,
layout=false,
layout=Docs,
children=[]
}) => {
@ -44,7 +45,7 @@ const PageWrapper= ({
noSearch: noSearch,
}
const Layout = layouts[layout]
const Layout = layout
return (
<div
@ -53,10 +54,12 @@ const PageWrapper= ({
data-theme={app.theme}
key={app.theme} // Thiis forces the data-theme update
>
{layout
? <Layout {...childProps}>{children}</Layout>
: children
}
<LayoutWrapper {...childProps}>
{Layout
? <Layout {...childProps}>{children}</Layout>
: children
}
</LayoutWrapper>
</div>
)
}