chore: seminarhof customer project
This commit is contained in:
34
apps/app/src/components/MarketingShell.tsx
Normal file
34
apps/app/src/components/MarketingShell.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Box } from '@pikku/mantine/core'
|
||||
import { usePikkuQuery } from '@project/functions-sdk/pikku/api.gen'
|
||||
import { AppLayout } from './AppLayout'
|
||||
import { SeminarhofHeader, SeminarhofFooter } from './SeminarhofChrome'
|
||||
|
||||
/**
|
||||
* Shell for the public marketing-facing pages (availability / events / enquiry).
|
||||
* Logged-in users keep the authenticated AppLayout (sidebar) so the admin
|
||||
* experience is consistent. Anonymous visitors get the seminarhof-drawehn.de
|
||||
* header + footer so the app and the marketing site feel like one website.
|
||||
*
|
||||
* Deliberately a sibling of PublicShell (not a variant) — pages opt into the
|
||||
* marketing chrome explicitly, so a future public route (e.g. kanban) can't
|
||||
* inherit it by accident.
|
||||
*/
|
||||
export function MarketingShell({ children }: { children: React.ReactNode }) {
|
||||
const { data, isLoading } = usePikkuQuery('me', null, { retry: false })
|
||||
|
||||
if (isLoading) {
|
||||
return <Box mih="100vh" />
|
||||
}
|
||||
|
||||
if (data) {
|
||||
return <AppLayout user={data}>{children}</AppLayout>
|
||||
}
|
||||
|
||||
return (
|
||||
<Box mih="100vh" style={{ display: 'flex', flexDirection: 'column', background: 'var(--brand-bg)' }}>
|
||||
<SeminarhofHeader />
|
||||
<Box style={{ flex: 1 }}>{children}</Box>
|
||||
<SeminarhofFooter />
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user