Chakra and globals

This commit is contained in:
2023-06-14 21:21:55 +04:00
parent 42c5b438c3
commit 2fbdc4cd44
10 changed files with 1872 additions and 23 deletions

View File

@@ -1,13 +1,34 @@
import Header from '~/app/components/header'
import { Providers } from '~/app/providers'
import { Container } from '~/app/ui'
import directus from '~/lib/directus'
export const metadata = {
title: 'PCA Pijac',
description: '',
async function getGlobals() {
return directus.items('globals').readOne(process.env.GLOBALS_ID)
}
export default function RootLayout({ children }) {
export async function generateMetadata() {
const globals = await getGlobals()
return {
title: globals.meta_title,
description: globals.meta_description,
}
}
export default async function RootLayout({ children }) {
const globals = await getGlobals()
return (
<html lang="en">
<body>{children}</body>
<body>
<Providers>
<Container maxW="3xl">
<Header siteName={globals.site_name} />
{children}
</Container>
</Providers>
</body>
</html>
)
}