This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
Instrument_Sans,
|
||||
} from "next/font/google";
|
||||
import Script from "next/script";
|
||||
import { Suspense } from "react";
|
||||
import "./globals.css";
|
||||
import { Analytics } from "@/components/Analytics";
|
||||
import { AmbientCanvas } from "@/components/layout/AmbientCanvas";
|
||||
@@ -53,17 +54,7 @@ export default function RootLayout({
|
||||
<body
|
||||
className={`${instrumentSans.variable} ${ibmPlexMono.variable} min-h-screen bg-paper font-sans text-ink antialiased`}
|
||||
>
|
||||
<Script id="theme-init" strategy="beforeInteractive">
|
||||
{`
|
||||
try {
|
||||
const storedTheme = localStorage.getItem("theme-preference");
|
||||
const theme = storedTheme === "light" || storedTheme === "dark"
|
||||
? storedTheme
|
||||
: (window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light");
|
||||
document.documentElement.dataset.theme = theme;
|
||||
} catch {}
|
||||
`}
|
||||
</Script>
|
||||
<Script src="/theme-init.js" strategy="beforeInteractive" />
|
||||
<a
|
||||
href="#main-content"
|
||||
className="sr-only focus:not-sr-only focus:absolute focus:left-4 focus:top-4 focus:z-[100] focus:rounded-full focus:bg-paper-strong focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-ink focus:shadow-[0_12px_30px_rgba(23,28,24,0.08)]"
|
||||
@@ -77,7 +68,9 @@ export default function RootLayout({
|
||||
{children}
|
||||
</main>
|
||||
<Footer />
|
||||
<Analytics />
|
||||
<Suspense fallback={null}>
|
||||
<Analytics />
|
||||
</Suspense>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user