Skip to content

Commit ded9a28

Browse files
drastically simplify MainLayout
1 parent 2e875e2 commit ded9a28

File tree

1 file changed

+6
-49
lines changed

1 file changed

+6
-49
lines changed

src/app/(main)/layout.tsx

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,19 @@
11
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"
72

83
import { Footer } from "@/components/footer"
9-
import { NewFontsStyleTag } from "../fonts"
104
import { Navbar } from "@/components/navbar/navbar"
115
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-
}
306

31-
export default function RootLayout({
7+
export default function MainLayout({
328
children,
339
}: {
3410
children: ReactNode
3511
}): ReactElement {
3612
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>
13+
<>
14+
<Navbar items={topLevelNavbarItems} />
15+
{children}
16+
<Footer />
17+
</>
6118
)
6219
}

0 commit comments

Comments
 (0)