From 064188855bdf8528e78afa684f3a247b64c69332 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Wed, 3 Jul 2024 10:09:49 +0200 Subject: Components: SideBar: Highlight current page --- src/components/Sidebar/Sidebar.tsx | 18 +++++++++--------- src/components/Sidebar/SidebarButton.tsx | 8 +++++++- src/pages/Home.tsx | 2 +- src/pages/Recent.tsx | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/components/Sidebar/Sidebar.tsx b/src/components/Sidebar/Sidebar.tsx index 28ae9a2..901ba87 100644 --- a/src/components/Sidebar/Sidebar.tsx +++ b/src/components/Sidebar/Sidebar.tsx @@ -1,21 +1,21 @@ import SidebarButton from "./SidebarButton"; -export default function SideBar() { +export default function SideBar(props: any) { return (
+ className="relative flex h-full w-full max-w-[20rem] flex-col rounded-xl bg-white bg-clip-border text-gray-700 shadow-xl shadow-blue-gray-900/5">
fs-tracer
-
) diff --git a/src/components/Sidebar/SidebarButton.tsx b/src/components/Sidebar/SidebarButton.tsx index 0af2c2c..efcb163 100644 --- a/src/components/Sidebar/SidebarButton.tsx +++ b/src/components/Sidebar/SidebarButton.tsx @@ -1,7 +1,13 @@ export default function SidebarButton(props: any) { + let buttonStyle = "flex items-center w-full p-3 leading-tight transition-all rounded-lg outline-none text-start hover:bg-blue-500" + + if (props.name === props.currentPage) { + buttonStyle += " border-2 border-black" + } + return (
+ className={buttonStyle}>
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 1bce297..37b97c3 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -36,7 +36,7 @@ export default function Home(props: any) { return ( <>
- +
diff --git a/src/pages/Recent.tsx b/src/pages/Recent.tsx index cecef25..b0e0601 100644 --- a/src/pages/Recent.tsx +++ b/src/pages/Recent.tsx @@ -34,7 +34,7 @@ export default function Recent(props: any) { return ( <>
- +
{files.map((file: any) => ( -- cgit 1.4.1