+3
-16
@@ -20,25 +20,12 @@ export const metadata = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const themeScript = `
|
|
||||||
(function () {
|
|
||||||
try {
|
|
||||||
const storedTheme = localStorage.getItem("theme");
|
|
||||||
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
||||||
const theme = storedTheme || (prefersDark ? "dark" : "light");
|
|
||||||
document.documentElement.classList.toggle("dark", theme === "dark");
|
|
||||||
} catch (_) {}
|
|
||||||
})();
|
|
||||||
`;
|
|
||||||
|
|
||||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning className="dark">
|
<html lang="en" className="dark">
|
||||||
<head>
|
<head />
|
||||||
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body className="bg-dark text-zinc-950 dark:bg-black dark:text-zinc-50">
|
<body className="bg-black text-zinc-50">
|
||||||
{" "}
|
{" "}
|
||||||
<Script src="https://umami.ash.gofwd.group/script.js" data-website-id="15c6b9ad-4119-4981-829c-26db69c07a15"
|
<Script src="https://umami.ash.gofwd.group/script.js" data-website-id="15c6b9ad-4119-4981-829c-26db69c07a15"
|
||||||
strategy="lazyOnload"
|
strategy="lazyOnload"
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import Image from "next/image";
|
|||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
import { useAuth } from "@/context/AuthContext";
|
import { useAuth } from "@/context/AuthContext";
|
||||||
import ThemeToggle from "@/components/ThemeToggle";
|
|
||||||
|
|
||||||
function NavLink({
|
function NavLink({
|
||||||
href,
|
href,
|
||||||
@@ -66,8 +65,6 @@ export function TopNav() {
|
|||||||
|
|
||||||
{/* Right side actions */}
|
{/* Right side actions */}
|
||||||
<div className="flex items-center justify-end gap-3 sm:gap-4">
|
<div className="flex items-center justify-end gap-3 sm:gap-4">
|
||||||
<ThemeToggle />
|
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<span className="text-xs text-zinc-500">Checking session…</span>
|
<span className="text-xs text-zinc-500">Checking session…</span>
|
||||||
) : isAuthenticated ? (
|
) : isAuthenticated ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user