-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlayout.tsx
57 lines (53 loc) · 1.82 KB
/
layout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { CssBaseline, ThemeProvider } from "@mui/material";
import { AppRouterCacheProvider } from "@mui/material-nextjs/v13-appRouter";
import { GoogleAnalytics } from "@next/third-parties/google";
import type { Metadata } from "next";
import logoLight from "@/techlabblog/assets/images/logo-light.png";
import Footer from "@/techlabblog/components/Footer";
import NavBar from "@/techlabblog/components/NavBar";
import { getSettings } from "@/techlabblog/lib/data";
import theme from "@/techlabblog/theme";
export const metadata: Metadata = {
title: "Technology | Code for Africa",
description:
"Tech adventures in Africa's civic labs: Coding, innovating, and disrupting for good across the continent.",
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const settings = await getSettings();
if (!settings) {
// TODO(kilemensi): log to sentry
return null;
}
const { analytics, connect, primaryNavigation, secondaryNavigation } =
settings;
// TODO(kilemensi): blurWidth/blurHeight https://github.com/vercel/next.js/issues/56511
const { blurWidth, blurHeight, ...logoProps } = logoLight;
const logo = {
...logoProps,
alt: "Technology | Code for Africa",
title: "Technology",
};
return (
<html lang="en">
<body>
<AppRouterCacheProvider>
<ThemeProvider theme={theme}>
<CssBaseline enableColorScheme />
<NavBar {...primaryNavigation} logo={logo} />
{children}
<Footer
connect={connect}
copyright={secondaryNavigation?.copyright}
secondaryMenus={secondaryNavigation?.menus}
/>
</ThemeProvider>
</AppRouterCacheProvider>
</body>
<GoogleAnalytics gaId={analytics?.analyticsId} />
</html>
);
}