From 125875c5e99eb165ae430c0e652926252550d555 Mon Sep 17 00:00:00 2001
From: Purp1e <438518244@qq.com>
Date: Fri, 27 Sep 2024 15:03:52 +0800
Subject: [PATCH] update: sidebar styles with routes
---
src/components/window/Card.tsx | 2 +-
src/components/window/SideBar.tsx | 45 +++++++++++++++++++++++--------
2 files changed, 35 insertions(+), 12 deletions(-)
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 (
-