[fix] building errors completed
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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,30 +19,31 @@ const Home = () => {
|
|||||||
// setFile(filePath?.join("\n") || " ")
|
// setFile(filePath?.join("\n") || " ")
|
||||||
// }
|
// }
|
||||||
return (
|
return (
|
||||||
<main
|
<>
|
||||||
className="flex flex-col items-center justify-center w-full h-screen gap-6"
|
<Nav />
|
||||||
data-tauri-drag-region
|
<main
|
||||||
>
|
className="flex flex-col items-center justify-center w-full h-screen gap-6"
|
||||||
<h1 className="text-4xl font-bold tracking-wide">
|
data-tauri-drag-region
|
||||||
CS 工具箱
|
|
||||||
</h1>
|
|
||||||
<Button
|
|
||||||
onPress={() => router.push("/home")}
|
|
||||||
variant="solid"
|
|
||||||
color="primary"
|
|
||||||
size="sm"
|
|
||||||
>
|
>
|
||||||
进入
|
<h1 className="text-4xl font-bold tracking-wide">CS 工具箱</h1>
|
||||||
</Button>
|
<Button
|
||||||
{/* <button
|
onPress={() => router.push("/home")}
|
||||||
type="button"
|
variant="solid"
|
||||||
onClick={openFile}
|
color="primary"
|
||||||
className="px-4 py-1 text-white bg-blue-500 rounded"
|
size="sm"
|
||||||
>
|
>
|
||||||
选择文件
|
进入
|
||||||
</button>
|
</Button>
|
||||||
<p className="text-center bg-zinc-50">{file}</p> */}
|
{/* <button
|
||||||
</main>
|
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"
|
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 />
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user