From 190b6aa79a251c7b41243ed2fda18427a97dafd1 Mon Sep 17 00:00:00 2001 From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com> Date: Sat, 18 Oct 2025 15:10:57 +0530 Subject: [PATCH] feat(sidebar): improve UI, use new settings dialog --- src/components/Sidebar.tsx | 71 ++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 6c300da..22224cc 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,20 +1,34 @@ 'use client'; import { cn } from '@/lib/utils'; -import { BookOpenText, Home, Search, SquarePen, Settings } from 'lucide-react'; +import { + BookOpenText, + Home, + Search, + SquarePen, + Settings, + Plus, + ArrowLeft, +} from 'lucide-react'; import Link from 'next/link'; import { useSelectedLayoutSegments } from 'next/navigation'; import React, { useState, type ReactNode } from 'react'; import Layout from './Layout'; +import { + Description, + Dialog, + DialogPanel, + DialogTitle, +} from '@headlessui/react'; +import SettingsButton from './Settings/SettingsButton'; const VerticalIconContainer = ({ children }: { children: ReactNode }) => { - return ( -
{children}
- ); + return
{children}
; }; const Sidebar = ({ children }: { children: React.ReactNode }) => { const segments = useSelectedLayoutSegments(); + const [isOpen, setIsOpen] = useState(true); const navLinks = [ { @@ -39,10 +53,13 @@ const Sidebar = ({ children }: { children: React.ReactNode }) => { return (
-
-
- - +
+
+ + {navLinks.map((link, i) => ( @@ -50,23 +67,41 @@ const Sidebar = ({ children }: { children: React.ReactNode }) => { key={i} href={link.href} className={cn( - 'relative flex flex-row items-center justify-center cursor-pointer hover:bg-black/10 dark:hover:bg-white/10 duration-150 transition w-full py-2 rounded-lg', + 'relative flex flex-col items-center justify-center space-y-0.5 cursor-pointer w-full py-2 rounded-lg', link.active - ? 'text-black dark:text-white' - : 'text-black/70 dark:text-white/70', + ? 'text-black/70 dark:text-white/70 ' + : 'text-black/60 dark:text-white/60', )} > - - {link.active && ( -
- )} +
+ +
+

+ {link.label} +

))} - - - +