[feat] basic path selection + common dir notification
This commit is contained in:
@@ -8,11 +8,14 @@ interface CardProps {
|
||||
onClick?: () => void
|
||||
}
|
||||
|
||||
const Card = ({ children }: CardProps) => {
|
||||
const Card = ({ children, className, ...props }: CardProps) => {
|
||||
return (
|
||||
<div
|
||||
className="dark:bg-white/[3%] dark:border-white/[6%] px-3 py-3 flex flex-col gap-2.5 border w-full rounded-lg bg-white/40 border-black/[6%]"
|
||||
className={cn(
|
||||
"dark:bg-white/[3%] dark:border-white/[6%] px-3 py-3 flex flex-col gap-2.5 border w-full rounded-lg bg-white/40 border-black/[6%]"
|
||||
, className)}
|
||||
data-tauri-drag-region
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -3,15 +3,7 @@ import { setTheme as setTauriTheme } from "@/hooks/tauri/theme"
|
||||
import { resetAppStore } from "@/store/app"
|
||||
import { resetToolStore } from "@/store/tool"
|
||||
import { addToast } from "@heroui/react"
|
||||
import {
|
||||
Close,
|
||||
Minus,
|
||||
Moon,
|
||||
Refresh,
|
||||
RocketOne,
|
||||
Square,
|
||||
SunOne,
|
||||
} from "@icon-park/react"
|
||||
import { Close, Minus, Moon, Refresh, RocketOne, Square, SunOne } from "@icon-park/react"
|
||||
import { type Theme, getCurrentWindow } from "@tauri-apps/api/window"
|
||||
import { /* relaunch, */ exit } from "@tauri-apps/plugin-process"
|
||||
import { useTheme } from "next-themes"
|
||||
@@ -49,13 +41,10 @@ const Nav = () => {
|
||||
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
|
||||
>
|
||||
<nav className="absolute top-0 right-0 flex flex-row h-16 gap-0.5 p-4" data-tauri-drag-region>
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={() => {
|
||||
resetAppStore()
|
||||
resetToolStore()
|
||||
@@ -69,22 +58,20 @@ const Nav = () => {
|
||||
<Refresh size={16} />
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
onClick={() =>
|
||||
pathname !== "/prepare" ? router.push("/prepare") : router.back()
|
||||
}
|
||||
>
|
||||
<RocketOne size={16} />
|
||||
</button>
|
||||
{pathname !== "/" && (
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={() => (pathname !== "/" ? router.push("/") : router.back())}
|
||||
>
|
||||
<RocketOne size={16} />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
onClick={() =>
|
||||
theme === "light" ? setAppTheme("dark") : setAppTheme("light")
|
||||
}
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={() => (theme === "light" ? setAppTheme("dark") : setAppTheme("light"))}
|
||||
>
|
||||
{theme === "light" ? <SunOne size={16} /> : <Moon size={16} />}
|
||||
</button>
|
||||
@@ -93,21 +80,21 @@ const Nav = () => {
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={minimize}
|
||||
>
|
||||
<Minus size={16} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={toggleMaximize}
|
||||
>
|
||||
<Square size={16} />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 active:scale-95"
|
||||
className="px-2 py-0 transition duration-150 rounded hover:bg-zinc-200/80 dark:hover:bg-zinc-100/10 active:scale-95"
|
||||
onClick={close}
|
||||
>
|
||||
<Close size={16} />
|
||||
|
||||
Reference in New Issue
Block a user