diff --git a/src/components/window/Card.tsx b/src/components/window/Card.tsx index 4e152cb..5b086fb 100644 --- a/src/components/window/Card.tsx +++ b/src/components/window/Card.tsx @@ -8,7 +8,7 @@ interface CardProps { const Card = ({ children }: CardProps) => { return (
{children} diff --git a/src/components/window/SideBar.tsx b/src/components/window/SideBar.tsx index b122955..d00e233 100644 --- a/src/components/window/SideBar.tsx +++ b/src/components/window/SideBar.tsx @@ -2,34 +2,58 @@ import { ReactNode } from "react" import clsx from "clsx" import { Home, MonitorOne, Movie, Setting, Terminal, Toolkit } from "@icon-park/react" -import { useRouter } from "next/navigation" +import { useRouter, usePathname } from "next/navigation" + // import { platform } from "@tauri-apps/plugin-os" import useAppStore from "@/store/app" interface SideButtonProps { + route: string className?: string children?: ReactNode } const SideButton = ({ + route, className, children, ...rest }: SideButtonProps & React.ButtonHTMLAttributes) => { + const router = useRouter() + const path = usePathname() + return ( - ) } const Avatar = () => { const router = useRouter() + const path = usePathname() return (
router.push("/users")} - className="w-12 h-12 bg-gray-700 rounded-full cursor-pointer" + className={clsx( + "w-12 h-12 bg-gray-700 rounded-full shadow-2xl cursor-pointer transition active:scale-95 shadow-purple-800", + path.startsWith("/users") && "shadow-sm" + )} > avatar
@@ -37,13 +61,12 @@ const Avatar = () => { } const SideBar = () => { - const router = useRouter() const { version, setVersion } = useAppStore() return (
{ className="flex flex-col items-center justify-center h-full gap-5" data-tauri-drag-region > - router.push("/home")}> + - router.push("/tool")}> + - router.push("/console")}> + - router.push("/gear")}> + - router.push("/movie")}> + - router.push("/preference")}> +