gen / src /app /layout.tsx
AnesKAM's picture
Upload 85 files
c5bbe78 verified
Raw History Blame Contribute Delete
2.25 kB
import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import { ThemeProvider } from "@/components/ThemeProvider";
import { ToastProvider } from "@/components/Toast";
import "./globals.css";
export const metadata: Metadata = {
title: {
default: "Fox — Private Search Engine",
template: "%s · Fox",
},
description:
"Fox is a fast, private search engine with live results from DuckDuckGo — All, Images, News and Videos tabs, saved results, collections and search history.",
applicationName: "Fox Search",
icons: {
icon: [
{ url: "/favicon.ico", sizes: "any" },
{ url: "/icons/favicon-16x16.png", type: "image/png", sizes: "16x16" },
{ url: "/icons/favicon-32x32.png", type: "image/png", sizes: "32x32" },
{ url: "/icons/favicon-48x48.png", type: "image/png", sizes: "48x48" },
{ url: "/icons/icon-192.png", type: "image/png", sizes: "192x192" },
{ url: "/icons/icon-512.png", type: "image/png", sizes: "512x512" },
],
shortcut: ["/favicon.ico"],
apple: [{ url: "/icons/apple-touch-icon.png", sizes: "180x180", type: "image/png" }],
},
manifest: "/manifest.webmanifest",
appleWebApp: {
capable: true,
title: "Fox Search",
statusBarStyle: "black-translucent",
},
};
export const viewport: Viewport = {
themeColor: "#14161a",
width: "device-width",
initialScale: 1,
};
const THEME_INIT_SCRIPT = `(function(){try{var t=localStorage.getItem('fox_theme');if(t==='light'||t==='dark'){document.documentElement.setAttribute('data-theme',t);}else{document.documentElement.setAttribute('data-theme','dark');}}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();`;
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" data-theme="dark" suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }} />
</head>
<body className="min-h-screen bg-[#f6f7f9] font-sans text-slate-900 antialiased transition-colors dark:bg-[#14161a] dark:text-[#e8eaed]">
<ThemeProvider>
<ToastProvider>{children}</ToastProvider>
</ThemeProvider>
</body>
</html>
);
}