fix: improve active state logic for navigation buttons
This commit is contained in:
parent
3dd0ecd970
commit
3878b84f4c
4 changed files with 17 additions and 12 deletions
|
|
@ -3,10 +3,13 @@ import { Home } from 'lucide-react'
|
|||
import BottomNavigationBarItem from './BottomNavigationBarItem'
|
||||
|
||||
export default function HomeButton() {
|
||||
const { navigate, current } = usePrimaryPage()
|
||||
const { navigate, current, display } = usePrimaryPage()
|
||||
|
||||
return (
|
||||
<BottomNavigationBarItem active={current === 'home'} onClick={() => navigate('home')}>
|
||||
<BottomNavigationBarItem
|
||||
active={current === 'home' && display}
|
||||
onClick={() => navigate('home')}
|
||||
>
|
||||
<Home />
|
||||
</BottomNavigationBarItem>
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue