Fix the mobile nav dropdown
This commit is contained in:
parent
5e4b0949c2
commit
27075088ee
1 changed files with 4 additions and 15 deletions
|
|
@ -22,16 +22,7 @@
|
||||||
const navItems: NavItem[] = [
|
const navItems: NavItem[] = [
|
||||||
{ icon: WorkIcon, text: 'Work', href: '/', variant: 'work' },
|
{ icon: WorkIcon, text: 'Work', href: '/', variant: 'work' },
|
||||||
{ icon: UniverseIcon, text: 'Universe', href: '/universe', variant: 'universe' },
|
{ icon: UniverseIcon, text: 'Universe', href: '/universe', variant: 'universe' },
|
||||||
{
|
{ icon: PhotosIcon, text: 'Photos', href: '/photos', variant: 'photos' },
|
||||||
icon: PhotosIcon,
|
|
||||||
text: 'Photography',
|
|
||||||
href: '/photos',
|
|
||||||
variant: 'photos',
|
|
||||||
subItems: [
|
|
||||||
{ text: 'Photos', href: '/photos' },
|
|
||||||
{ text: 'Albums', href: '/albums' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ icon: LabsIcon, text: 'Labs', href: '/labs', variant: 'labs' },
|
{ icon: LabsIcon, text: 'Labs', href: '/labs', variant: 'labs' },
|
||||||
{ icon: AboutIcon, text: 'About', href: '/about', variant: 'about' }
|
{ icon: AboutIcon, text: 'About', href: '/about', variant: 'about' }
|
||||||
]
|
]
|
||||||
|
|
@ -42,11 +33,9 @@
|
||||||
? navItems[0]
|
? navItems[0]
|
||||||
: currentPath === '/about'
|
: currentPath === '/about'
|
||||||
? navItems[4]
|
? navItems[4]
|
||||||
: currentPath.startsWith('/albums') || currentPath.startsWith('/photos')
|
: navItems.find((item) =>
|
||||||
? navItems.find((item) => item.variant === 'photos')
|
currentPath.startsWith(item.href === '/' ? '/work' : item.href)
|
||||||
: navItems.find((item) =>
|
) || navItems[0]
|
||||||
currentPath.startsWith(item.href === '/' ? '/work' : item.href)
|
|
||||||
) || navItems[0]
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Get background color based on variant
|
// Get background color based on variant
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue