This commit is contained in:
Denozordec
2026-05-03 11:16:07 +07:00
parent ce00c4c671
commit bdb9b72fac
66 changed files with 9553 additions and 1547 deletions
+1 -19
View File
@@ -1,6 +1,5 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import Script from "next/script";
import { TooltipProvider } from "@/components/ui/tooltip";
import { ThemeProvider } from "@/components/theme-provider";
import "./globals.css";
@@ -20,18 +19,6 @@ export const metadata: Metadata = {
description: "MikroTik network management platform",
};
// Runs before React hydration — prevents flash of wrong theme (FOUC).
const ANTI_FOUC = `
try {
var t = localStorage.getItem('rl-theme') || 'dark';
var d = t === 'system'
? window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
: t;
document.documentElement.classList.toggle('dark', d === 'dark');
document.documentElement.classList.toggle('light', d === 'light');
} catch(e) {}
`.trim()
export default function RootLayout({
children,
}: Readonly<{
@@ -43,13 +30,8 @@ export default function RootLayout({
suppressHydrationWarning
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<head>
<Script id="anti-fouc" strategy="beforeInteractive">
{ANTI_FOUC}
</Script>
</head>
<body className="min-h-full flex flex-col">
<ThemeProvider defaultTheme="dark" disableTransitionOnChange>
<ThemeProvider>
<TooltipProvider>{children}</TooltipProvider>
</ThemeProvider>
</body>