Skip to content

Commit 3e4dcec

Browse files
authored
fix: improve highlighting for current subnav (#6240)
1 parent 02fb7bd commit 3e4dcec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/Navigation/Navigation.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,13 @@ function Navigation({ links, pathname, hash = '', toggleSidebar }) {
212212
{link.children.map((child) => {
213213
const classNames =
214214
'text-blue-400 py-5 text-sm capitalize hover:text-black dark:hover:text-white';
215+
const isActive = location.pathname.startsWith(child.url);
215216
return (
216217
<NavLink
217218
key={child.url}
218219
to={child.url}
219220
title={child.title}
220-
className={({ isActive }) =>
221+
className={() =>
221222
isActive
222223
? `!text-black dark:!text-white ${classNames}`
223224
: classNames

0 commit comments

Comments
 (0)