Skip to content

Commit

Permalink
Add removed components
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvinkipruto committed Sep 20, 2024
1 parent bf219db commit 188cae1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 183 deletions.
9 changes: 5 additions & 4 deletions apps/techlabblog/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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 theme from "@/techlabblog/theme";

import { getSettings } from "@/techlabblog/lib/data";
import logoLight from "@/techlabblog/assets/images/logo-light.png";
import theme from "@/techlabblog/theme";

export const metadata: Metadata = {
title: "Technology | Code for Africa",
Expand All @@ -20,7 +20,7 @@ export default async function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const { connect, primaryNavigation, secondaryNavigation } =
const { analytics, connect, primaryNavigation, secondaryNavigation } =
await getSettings();
// TODO: blurWidth/blurHeight https://github.com/vercel/next.js/issues/56511
const { blurWidth, blurHeight, ...logoProps } = logoLight;
Expand All @@ -46,6 +46,7 @@ export default async function RootLayout({
</ThemeProvider>
</AppRouterCacheProvider>
</body>
<GoogleAnalytics gaId={analytics?.analyticsId} />
</html>
);
}
2 changes: 2 additions & 0 deletions apps/techlabblog/content/site/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ connect:
url: https://www.instagram.com/code4africa__/
- platform: Github
url: https://github.com/CodeForAfrica
analytics:
analyticsId: "G-TN1WGZVHLE"
---
6 changes: 6 additions & 0 deletions apps/techlabblog/lib/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,23 @@ interface SecondaryNavigationProps extends NavigationProps {
copyright: string;
}

export type AnalyticsProps = {
analyticsId: string;
};

type SettingsProps = {
title: string;
primaryNavigation: PrimaryNavigationProps;
secondaryNavigation: SecondaryNavigationProps;
connect: ConnectProps;
analytics: AnalyticsProps;
};

async function readSettingsFile(filePath: string): Promise<SettingsProps> {
const { data } = await readMdFile(filePath);

return {
analytics: data.analytics,
connect: data.connect,
primaryNavigation: data.primaryNavigation,
secondaryNavigation: data.secondaryNavigation,
Expand Down
Loading

0 comments on commit 188cae1

Please sign in to comment.