Skip to content

Commit

Permalink
[Navigation bar] Fix active status for subpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
rikurauhala committed Dec 2, 2024
1 parent 324fcb7 commit 132a21e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const NavigationBar = () => {

const isActivePath = (mainPath: string | undefined, subPaths: (string | undefined)[] = []) => {
const allPaths = [mainPath, ...subPaths].filter(Boolean)
return allPaths.some(currentPath => location.pathname === currentPath)
return allPaths.some(currentPath => location.pathname.includes(currentPath))
}

const getVisibleNavigationItems = () => {
Expand Down

0 comments on commit 132a21e

Please sign in to comment.