update dep + preference styles setup

This commit is contained in:
Purp1e
2024-10-28 10:42:42 +08:00
parent c0c34180ae
commit 3d027ec05f
13 changed files with 1737 additions and 1160 deletions

View File

@@ -1,8 +1,10 @@
import { ReactNode } from "react"
import clsx from "clsx"
interface CardProps {
children?: ReactNode
className?: string
type?: string
onClick?: () => void
}
@@ -18,12 +20,12 @@ const Card = ({ children }: CardProps) => {
}
const CardHeader = ({ children }: CardProps) => {
return <div className="flex items-center gap-2.5 tracking-wide">{children}</div>
return <div className="flex items-center gap-1.5 tracking-wide">{children}</div>
}
const CardIcon = ({ children, ...rest }: CardProps) => {
const CardIcon = ({ children, type, className, ...rest }: CardProps) => {
return (
<div className="flex gap-1.5 items-center font-semibold" {...rest}>
<div className={clsx("flex gap-1.5 items-center font-semibold", type === "menu" && "transition cursor-pointer hover:bg-white/60 px-2 py-1 rounded-md active:scale-95", className)} {...rest}>
{children}
</div>
)

View File

@@ -3,7 +3,7 @@ import { RocketOne, Minus, Close, Square } from "@icon-park/react"
import { /* relaunch, */ exit } from "@tauri-apps/plugin-process"
import { getCurrentWindow } from "@tauri-apps/api/window"
// import { platform } from "@tauri-apps/plugin-os"
import { useRouter } from "next/navigation"
import { useRouter, usePathname } from "next/navigation"
const Nav = () => {
const close = async () => {
@@ -32,12 +32,13 @@ const Nav = () => {
// await relaunch()
// }
const router = useRouter()
const pathname = usePathname()
return (
<nav className="absolute top-0 right-0 flex flex-row h-16 gap-0.5 p-4" data-tauri-drag-region>
<button
className="px-2 py-0 transition rounded hover:bg-zinc-200/80 active:scale-95"
onClick={() => router.push("/prepare")}
onClick={() => pathname !== "/prepare" ? router.push("/prepare") : router.back()}
>
<RocketOne size={16} />
</button>