[fix] building errors completed

This commit is contained in:
2025-03-14 19:25:11 +08:00
parent ff8ec7e05f
commit 815cdb55f1
4 changed files with 40 additions and 36 deletions

View File

@@ -1,10 +1,4 @@
"use client" // "use client"
// export const metadata = {
// title: "CS工具箱",
// description: "Generated by Next.js",
// icons: ["/favicon.ico"],
// }
import "./globals.css" import "./globals.css"
import Providers from "./providers" import Providers from "./providers"
@@ -15,7 +9,7 @@ export default function RootLayout({
}) { }) {
return ( return (
<html lang="en"> <html lang="en">
<body className="bg-zinc-100 dark:bg-zinc-900"> <body>
<Providers>{children}</Providers> <Providers>{children}</Providers>
</body> </body>
</html> </html>

View File

@@ -1,5 +1,6 @@
"use client" "use client"
import Nav from "@/components/window/Nav"
import { Button } from "@heroui/react" import { Button } from "@heroui/react"
// import { open } from "@tauri-apps/plugin-dialog" // import { open } from "@tauri-apps/plugin-dialog"
import { useRouter } from "next/navigation" import { useRouter } from "next/navigation"
@@ -18,13 +19,13 @@ const Home = () => {
// setFile(filePath?.join("\n") || " ") // setFile(filePath?.join("\n") || " ")
// } // }
return ( return (
<>
<Nav />
<main <main
className="flex flex-col items-center justify-center w-full h-screen gap-6" className="flex flex-col items-center justify-center w-full h-screen gap-6"
data-tauri-drag-region data-tauri-drag-region
> >
<h1 className="text-4xl font-bold tracking-wide"> <h1 className="text-4xl font-bold tracking-wide">CS </h1>
CS
</h1>
<Button <Button
onPress={() => router.push("/home")} onPress={() => router.push("/home")}
variant="solid" variant="solid"
@@ -42,6 +43,7 @@ const Home = () => {
</button> </button>
<p className="text-center bg-zinc-50">{file}</p> */} <p className="text-center bg-zinc-50">{file}</p> */}
</main> </main>
</>
) )
} }

View File

@@ -1,8 +1,7 @@
"use client"
import Nav from "@/components/window/Nav" import Nav from "@/components/window/Nav"
export default function BaseLayout({ export default function BaseLayout({ children }: { children: React.ReactNode }) {
children,
}: { children: React.ReactNode }) {
return ( return (
<div className="w-full h-full"> <div className="w-full h-full">
<Nav /> <Nav />

View File

@@ -1,11 +1,20 @@
"use client" "use client"
import { HeroUIProvider } from "@heroui/react" import { HeroUIProvider, cn } from "@heroui/react"
import { ToastProvider } from "@heroui/toast" import { ToastProvider } from "@heroui/toast"
import { platform } from "@tauri-apps/plugin-os"
import { ThemeProvider as NextThemesProvider } from "next-themes" import { ThemeProvider as NextThemesProvider } from "next-themes"
import { useEffect, useState } from "react"
export default function Providers({ children }: { children: React.ReactNode }) { export default function Providers({ children }: { children: React.ReactNode }) {
const [os, setOs] = useState("windows")
useEffect(() => {
setOs(platform())
}, [])
return ( return (
<HeroUIProvider className="h-full bg-transparent"> <HeroUIProvider
className={cn("h-full bg-zinc-100/90 dark:bg-zinc-900", os === "macos" && "rounded-lg")}
>
<NextThemesProvider attribute="class" defaultTheme="light"> <NextThemesProvider attribute="class" defaultTheme="light">
<ToastProvider toastOffset={10} placement="top-center" /> <ToastProvider toastOffset={10} placement="top-center" />
{children} {children}