[fix] building errors completed
This commit is contained in:
@@ -1,10 +1,4 @@
|
||||
"use client"
|
||||
// export const metadata = {
|
||||
// title: "CS工具箱",
|
||||
// description: "Generated by Next.js",
|
||||
// icons: ["/favicon.ico"],
|
||||
// }
|
||||
|
||||
// "use client"
|
||||
import "./globals.css"
|
||||
import Providers from "./providers"
|
||||
|
||||
@@ -15,7 +9,7 @@ export default function RootLayout({
|
||||
}) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body className="bg-zinc-100 dark:bg-zinc-900">
|
||||
<body>
|
||||
<Providers>{children}</Providers>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import Nav from "@/components/window/Nav"
|
||||
import { Button } from "@heroui/react"
|
||||
// import { open } from "@tauri-apps/plugin-dialog"
|
||||
import { useRouter } from "next/navigation"
|
||||
@@ -18,30 +19,31 @@ const Home = () => {
|
||||
// setFile(filePath?.join("\n") || " ")
|
||||
// }
|
||||
return (
|
||||
<main
|
||||
className="flex flex-col items-center justify-center w-full h-screen gap-6"
|
||||
data-tauri-drag-region
|
||||
>
|
||||
<h1 className="text-4xl font-bold tracking-wide">
|
||||
CS 工具箱
|
||||
</h1>
|
||||
<Button
|
||||
onPress={() => router.push("/home")}
|
||||
variant="solid"
|
||||
color="primary"
|
||||
size="sm"
|
||||
<>
|
||||
<Nav />
|
||||
<main
|
||||
className="flex flex-col items-center justify-center w-full h-screen gap-6"
|
||||
data-tauri-drag-region
|
||||
>
|
||||
进入
|
||||
</Button>
|
||||
{/* <button
|
||||
type="button"
|
||||
onClick={openFile}
|
||||
className="px-4 py-1 text-white bg-blue-500 rounded"
|
||||
>
|
||||
选择文件
|
||||
</button>
|
||||
<p className="text-center bg-zinc-50">{file}</p> */}
|
||||
</main>
|
||||
<h1 className="text-4xl font-bold tracking-wide">CS 工具箱</h1>
|
||||
<Button
|
||||
onPress={() => router.push("/home")}
|
||||
variant="solid"
|
||||
color="primary"
|
||||
size="sm"
|
||||
>
|
||||
进入
|
||||
</Button>
|
||||
{/* <button
|
||||
type="button"
|
||||
onClick={openFile}
|
||||
className="px-4 py-1 text-white bg-blue-500 rounded"
|
||||
>
|
||||
选择文件
|
||||
</button>
|
||||
<p className="text-center bg-zinc-50">{file}</p> */}
|
||||
</main>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
"use client"
|
||||
import Nav from "@/components/window/Nav"
|
||||
|
||||
export default function BaseLayout({
|
||||
children,
|
||||
}: { children: React.ReactNode }) {
|
||||
export default function BaseLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<div className="w-full h-full">
|
||||
<Nav />
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
"use client"
|
||||
import { HeroUIProvider } from "@heroui/react"
|
||||
import { HeroUIProvider, cn } from "@heroui/react"
|
||||
import { ToastProvider } from "@heroui/toast"
|
||||
import { platform } from "@tauri-apps/plugin-os"
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
||||
import { useEffect, useState } from "react"
|
||||
|
||||
export default function Providers({ children }: { children: React.ReactNode }) {
|
||||
const [os, setOs] = useState("windows")
|
||||
useEffect(() => {
|
||||
setOs(platform())
|
||||
}, [])
|
||||
|
||||
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">
|
||||
<ToastProvider toastOffset={10} placement="top-center" />
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user