Browse Source
fix: handle subpaths in menu entries navigation
Signed-off-by: alok8bb <alok8bb@gmail.com>
pull/2/head
alok8bb
5 months ago
Failed to extract signature
1 changed files with
3 additions and
1 deletions
-
src/components/Container.tsx
|
@ -120,7 +120,9 @@ const Container: React.FC<{ |
|
|
} catch {} |
|
|
} 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 next = get.next(MenuEntries, current)[1]; |
|
|
const prev = get.prev(MenuEntries, current)[1]; |
|
|
const prev = get.prev(MenuEntries, current)[1]; |
|
|
const end = current === MenuEntries.length - 1; |
|
|
const end = current === MenuEntries.length - 1; |
|
|