File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import EscapeOutside from "react-escape-outside";
4
4
import NavbarLink from "../navbarLink/navbarLink" ;
5
5
import styles from "../navbar/navbar.module.scss" ;
6
6
import NavbarMenu from "../navbarMenu/navbarMenu" ;
7
- import data from "../../content /components/navbarItems.json" ;
7
+ import data from "../../data /components/navbarItems.json" ;
8
8
9
9
const NavbarItem = ( {
10
10
itemLabel,
@@ -38,11 +38,13 @@ const NavbarItem = ({
38
38
label = { itemLabel }
39
39
link = { itemLink }
40
40
styleLink = {
41
- ( asPath . slice ( 0 , itemLink . length ) === itemLink ||
42
- itemLink . slice ( 0 , data . navbarItems [ 0 ] . reducedSlug . length ) ===
43
- asPath . slice ( 0 , data . navbarItems [ 0 ] . reducedSlug . length ) ) &&
44
- asPath !== data . navbarItems [ 2 ] . navbarSubMenuItems [ 2 ] . link &&
45
- asPath !== data . navbarItems [ 3 ] . link
41
+ asPath !== data . navbarItems [ 3 ] . link &&
42
+ ( itemLink === asPath ||
43
+ itemMenu ?. find (
44
+ item =>
45
+ item . link === asPath ||
46
+ item . subMenuSection ?. find ( subItem => subItem . link === asPath )
47
+ ) )
46
48
? styles . selectedNavbarItem
47
49
: undefined
48
50
}
You can’t perform that action at this time.
0 commit comments