mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(layout): integrate mode toggle in layout and simplify home page structure
This commit is contained in:
parent
286a4739c3
commit
96c946a2ca
@ -1,5 +1,6 @@
|
|||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
|
import { ModeToggle } from "@/components/mode-toggle";
|
||||||
import { ThemeProvider } from "@/components/theme-provider";
|
import { ThemeProvider } from "@/components/theme-provider";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
@ -14,14 +15,19 @@ export default function RootLayout({
|
|||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning>
|
<html lang="en" suppressHydrationWarning>
|
||||||
<body className="antialiased">
|
<body className="h-screen flex flex-col antialiased">
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
attribute="class"
|
attribute="class"
|
||||||
defaultTheme="system"
|
defaultTheme="system"
|
||||||
enableSystem
|
enableSystem
|
||||||
disableTransitionOnChange
|
disableTransitionOnChange
|
||||||
>
|
>
|
||||||
|
<header className="h-14 flex items-center justify-end px-8 border-b">
|
||||||
|
<ModeToggle />
|
||||||
|
</header>
|
||||||
|
<main className="flex-1">
|
||||||
{children}
|
{children}
|
||||||
|
</main>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
import CodeEditor from "@/components/code-editor";
|
import CodeEditor from "@/components/code-editor";
|
||||||
import { ModeToggle } from "@/components/mode-toggle";
|
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return <CodeEditor />;
|
||||||
<div className="h-screen flex flex-col">
|
|
||||||
<header className="h-14 flex items-center justify-end px-8 border-b">
|
|
||||||
<ModeToggle />
|
|
||||||
</header>
|
|
||||||
<div className="flex-1">
|
|
||||||
<CodeEditor />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user