Improved group detail look and feel
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Link, useLocation } from '@tanstack/react-router'
|
||||
import { cn } from '../../lib/utils'
|
||||
import { Logo } from '../brand'
|
||||
import { NAV_ITEMS } from './nav-items'
|
||||
import { isNavItemActive, NAV_ITEMS } from './nav-items'
|
||||
|
||||
export function Sidebar() {
|
||||
const location = useLocation()
|
||||
@@ -16,16 +16,17 @@ export function Sidebar() {
|
||||
|
||||
<nav className="flex flex-col gap-1">
|
||||
{NAV_ITEMS.map(({ label, to, icon: Icon }) => {
|
||||
const isActive = location.pathname === to
|
||||
const isActive = isNavItemActive(location.pathname, to)
|
||||
return (
|
||||
<Link
|
||||
key={to}
|
||||
to={to}
|
||||
aria-current={isActive ? 'page' : undefined}
|
||||
className={cn(
|
||||
'flex items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-medium transition-colors',
|
||||
isActive
|
||||
? 'bg-accent-soft text-accent-fg'
|
||||
: 'text-foreground/60 hover:bg-primary-soft hover:text-primary',
|
||||
: 'text-foreground/80 hover:bg-primary-soft hover:text-primary',
|
||||
)}
|
||||
>
|
||||
<Icon className="size-5" strokeWidth={isActive ? 2.2 : 2} />
|
||||
|
||||
Reference in New Issue
Block a user