Skip to content

Commit

Permalink
Add logic for matching urls
Browse files Browse the repository at this point in the history
  • Loading branch information
mutuajames committed Jul 4, 2023
1 parent 4264b74 commit d0667b8
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 d0667b8

Please sign in to comment.