Skip to content

Commit

Permalink
Merge pull request #1225 from opensrp/1223-fix-active-path
Browse files Browse the repository at this point in the history
Add logic for matching urls
  • Loading branch information
dubdabasoduba authored Jul 4, 2023
2 parents c6bc48c + 17e0820 commit 641ece4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/components/page/Sidebar/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export function getActivePath(path: string, routes: Route[]) {
let openKey: string | undefined;

function mapPaths(menu: Route) {
// Check for matching url
if (menu.url && path.includes(menu.url)) activeKey = menu.key;
// Exact match
if (path === menu.url) activeKey = menu.key;
// Check if the menu has children
if (menu.children) {
Expand Down

0 comments on commit 641ece4

Please sign in to comment.