Browse Source
merge: #2 from alok8bb/master
fix: handle subpaths in menu entries navigation
master
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
1 deletions
-
src/components/Container.tsx
|
|
@ -120,7 +120,9 @@ const Container: React.FC<{ |
|
|
|
} catch {} |
|
|
|
}; |
|
|
|
|
|
|
|
const current = MenuEntries.findIndex(([, path]) => location === path); |
|
|
|
const current = MenuEntries.findIndex( |
|
|
|
([, path]) => location === path || location.startsWith(path + "/"), |
|
|
|
); |
|
|
|
const next = get.next(MenuEntries, current)[1]; |
|
|
|
const prev = get.prev(MenuEntries, current)[1]; |
|
|
|
const end = current === MenuEntries.length - 1; |
|
|
|