From ec0ee1ccb4b2d1df6c8dbce7be1ee265abf91c57 Mon Sep 17 00:00:00 2001 From: Timothy Russo Date: Sat, 23 Sep 2023 15:30:04 +0200 Subject: [PATCH 1/6] feat: add sidebar shadow --- src/app/globals.css | 10 +++++++++- src/components/sidebar/Sidebar.tsx | 6 +++++- tailwind.config.js | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 273d332d..15a252ac 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -20,4 +20,12 @@ ::-webkit-scrollbar-thumb:hover { background: #C0C0C0; -} \ No newline at end of file +} + +.sidebar-shadow-light { + box-shadow: 8px 0 10px -5px var(--neutral-focus); + } + +.sidebar-shadow-dark { + box-shadow: 8px 0 10px -5px var(--neutral-focus); + } \ No newline at end of file diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 393e3a66..c375490b 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -8,6 +8,7 @@ import { BookmarkSquareIcon, RocketLaunchIcon, } from "@heroicons/react/24/solid"; +import { useTheme } from "next-themes"; import PageButton from "./PageButton"; import VoyagePageButton from "./VoyagePageButton"; import VoyageStatus from "./VoyageStatus"; @@ -106,6 +107,7 @@ const voyageData = { export default function Sidebar() { const currentPath = usePathname(); + const { theme } = useTheme(); const [isOpenSidebar, setIsOpenSidebar] = useState(true); const [selectedButton, setSelectedButton] = useState(currentPath); @@ -123,11 +125,13 @@ export default function Sidebar() { } }; + const isDark = theme === "dark"; + return (