fix: update sidebar button active state logic

This commit is contained in:
codytseng 2025-10-20 10:00:18 +08:00
parent 6090c01965
commit 09c05cc62a
6 changed files with 12 additions and 12 deletions

View file

@ -3,13 +3,13 @@ import { Home } from 'lucide-react'
import SidebarItem from './SidebarItem'
export default function HomeButton({ collapse }: { collapse: boolean }) {
const { navigate, current } = usePrimaryPage()
const { navigate, current, display } = usePrimaryPage()
return (
<SidebarItem
title="Home"
onClick={() => navigate('home')}
active={current === 'home'}
active={display && current === 'home'}
collapse={collapse}
>
<Home />