Skip to content

Commit 5458a38

Browse files
[Fixed]: Navbar Active State Not Highlighting Docs and Specification related pages (#1537)
* fixed Navbar Active State Not Highlighting Docs and Specification on Related Pages * Adding few edge cases * Fix prettier --------- Co-authored-by: Benjamin Granados <[email protected]>
1 parent 4f081ac commit 5458a38

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

components/Layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ const MainNavLink = ({
137137
className?: string;
138138
}) => {
139139
const router = useRouter();
140-
const isActiveNav = router.asPath.startsWith(uri);
140+
const isActiveNav =
141+
router.asPath.startsWith(uri) ||
142+
(uri === '/docs' && router.asPath.startsWith('/overview')) ||
143+
(uri === '/docs' && router.asPath.startsWith('/learn')) ||
144+
(uri === '/docs' && router.asPath.startsWith('/implementers')) ||
145+
(uri === '/docs' &&
146+
router.asPath.startsWith('/understanding-json-schema')) ||
147+
(uri === '/specification' && router.asPath.startsWith('/draft'));
141148

142149
return (
143150
<Link

0 commit comments

Comments
 (0)