- bookmark management with dnd-kit reordering, bulk edit, search, category filter/rename, and meta auto-fetch - migrate /bookmarks → /dashboard/bookmarks under (main) layout - homepage redesign with category grid, /-key search, dock tooltips - theme toggle + use-theme, sonner toasts, alert-dialog/skeleton, visual refresh of auth pages Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
68 lines
1.7 KiB
TypeScript
68 lines
1.7 KiB
TypeScript
import type { Metadata, Viewport } from "next";
|
|
import { Geist, Geist_Mono } from "next/font/google";
|
|
import { Toaster } from "sonner";
|
|
import "./globals.css";
|
|
|
|
const geistSans = Geist({
|
|
variable: "--font-geist-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: {
|
|
default: "EvanPage",
|
|
template: "%s · EvanPage",
|
|
},
|
|
description: "个人主页与导航",
|
|
icons: {
|
|
icon: "/favicon.ico",
|
|
},
|
|
};
|
|
|
|
export const viewport: Viewport = {
|
|
width: "device-width",
|
|
initialScale: 1,
|
|
themeColor: [
|
|
{ media: "(prefers-color-scheme: light)", color: "#fafbff" },
|
|
{ media: "(prefers-color-scheme: dark)", color: "#0e1117" },
|
|
],
|
|
};
|
|
|
|
const themeInitScript = `
|
|
(function() {
|
|
try {
|
|
var stored = localStorage.getItem('theme');
|
|
var prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
var resolved = stored === 'dark' || stored === 'light' ? stored : (prefersDark ? 'dark' : 'light');
|
|
if (resolved === 'dark') document.documentElement.classList.add('dark');
|
|
} catch (e) {}
|
|
})();
|
|
`;
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html
|
|
lang="zh-CN"
|
|
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
|
suppressHydrationWarning
|
|
>
|
|
<head>
|
|
<script dangerouslySetInnerHTML={{ __html: themeInitScript }} />
|
|
</head>
|
|
<body className="min-h-full flex flex-col bg-background text-foreground">
|
|
{children}
|
|
<Toaster richColors position="top-right" />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|