Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7356589

Browse files
committed
fix: taas navbar updates
- also highlights the current menu item even when we are on some subroute
1 parent 083527a commit 7356589

File tree

2 files changed

+6
-22
lines changed

2 files changed

+6
-22
lines changed

src/components/NavLink/index.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ import React from "react";
77
import { Link } from "@reach/router";
88
import cn from "classnames";
99

10-
const NavLink = ({ to, className, activeClassName, children }) => (
10+
const NavLink = ({ to, className, activeClassName, children, exact }) => (
1111
<Link
1212
to={to}
13-
getProps={({ isCurrent }) => {
13+
getProps={({ isCurrent, isPartiallyCurrent }) => {
1414
// the object returned here is passed to the
1515
// anchor element's props
1616
return {
17-
className: cn(className, { [activeClassName]: isCurrent }),
17+
className: cn(className, {
18+
[activeClassName]: exact ? isCurrent : isPartiallyCurrent,
19+
}),
1820
};
1921
}}
2022
>

src/constants/apps.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,32 +57,14 @@ export const APP_CATEGORIES = [
5757
{
5858
title: "TaaS",
5959
icon: appTaasIcon,
60-
path: "/taas",
60+
path: "/taas/myteams",
6161
menu: [
6262
{
6363
title: "My Teams",
6464
path: "/taas/myteams",
6565
icon: myteamsIcon,
6666
activeIcon: myteamsGreenIcon,
6767
},
68-
{
69-
title: "Feedback",
70-
path: "/taas/feedback",
71-
icon: discussionsIcon,
72-
activeIcon: discussionsGreenIcon,
73-
},
74-
{
75-
title: "Invoices",
76-
path: "/taas/invoices",
77-
icon: apisIcon,
78-
activeIcon: apisGreenIcon,
79-
},
80-
{
81-
title: "Reports",
82-
path: "/taas/reports",
83-
icon: reportsIcon,
84-
activeIcon: reportsGreenIcon,
85-
},
8668
],
8769
},
8870
{

0 commit comments

Comments
 (0)