Skip to content

Commit 80101db

Browse files
layout updates
1 parent 43a75c4 commit 80101db

File tree

3 files changed

+65
-13
lines changed

3 files changed

+65
-13
lines changed

src/app/(conf)/conf/layout.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,5 @@ export default function ConfLayout({
33
}: {
44
children: React.ReactNode
55
}) {
6-
return (
7-
<html lang="en">
8-
<body>
9-
conference site layout
10-
{children}
11-
</body>
12-
</html>
13-
)
6+
return children
147
}

src/app/(main)/layout.tsx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { ReactElement, ReactNode } from "react"
2+
import { Metadata } from "next"
3+
import GoogleAnalytics from "@/app/ga"
4+
5+
// @ts-expect-error: we want to import the same version as Nextra for the main page
6+
import { ThemeProvider } from "next-themes"
7+
8+
import { Footer } from "@/components/footer"
9+
import { NewFontsStyleTag } from "../fonts"
10+
import { Navbar } from "@/components/navbar/navbar"
11+
import { topLevelNavbarItems } from "@/components/navbar/top-level-items"
12+
import { MenuProvider } from "../(main)/menu-provider"
13+
14+
import "../../globals.css"
15+
import "../colors.css"
16+
17+
export const metadata: Metadata = {
18+
twitter: {
19+
site: "@graphql",
20+
card: "summary_large_image",
21+
},
22+
metadataBase: new URL("https://graphql.org"),
23+
keywords: ["GraphQL"],
24+
applicationName: "GraphQL.ORG",
25+
title: {
26+
absolute: "",
27+
template: "%s | GraphQL",
28+
},
29+
}
30+
31+
export default function RootLayout({
32+
children,
33+
}: {
34+
children: ReactNode
35+
}): ReactElement {
36+
return (
37+
<html
38+
lang="en"
39+
className="scroll-smooth"
40+
// ThemeProvider adds a `light`/`dark` class
41+
suppressHydrationWarning
42+
>
43+
<head>
44+
<style>{`html { scroll-padding-top: 5rem }`}</style>
45+
</head>
46+
<body className="bg-neu-0">
47+
<GoogleAnalytics />
48+
<NewFontsStyleTag />
49+
<ThemeProvider attribute="class">
50+
<MenuProvider>
51+
<Navbar items={topLevelNavbarItems} />
52+
<div className="isolate bg-neu-0 text-neu-900 antialiased">
53+
<h1 style={{ fontSize: 200 }}>MAIN LAYOUT</h1>
54+
{children}
55+
</div>
56+
<Footer />
57+
</MenuProvider>
58+
</ThemeProvider>
59+
</body>
60+
</html>
61+
)
62+
}

src/app/layout.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import GoogleAnalytics from "@/app/ga"
55
// @ts-expect-error: we want to import the same version as Nextra for the main page
66
import { ThemeProvider } from "next-themes"
77

8-
import { Footer } from "../components/footer"
98
import { NewFontsStyleTag } from "./fonts"
10-
import { Navbar } from "../components/navbar/navbar"
11-
import { topLevelNavbarItems } from "../components/navbar/top-level-items"
129
import { MenuProvider } from "./(main)/menu-provider"
1310

1411
import "../globals.css"
@@ -48,11 +45,11 @@ export default function RootLayout({
4845
<NewFontsStyleTag />
4946
<ThemeProvider attribute="class">
5047
<MenuProvider>
51-
<Navbar items={topLevelNavbarItems} />
5248
<div className="isolate bg-neu-0 text-neu-900 antialiased">
49+
<h1 style={{ fontSize: 200 }}>ROOT LAYOUT</h1>
50+
5351
{children}
5452
</div>
55-
<Footer />
5653
</MenuProvider>
5754
</ThemeProvider>
5855
</body>

0 commit comments

Comments
 (0)