Skip to content

Commit 72883db

Browse files
authored
Fixes active navbar (#1534)
1 parent ae80dc4 commit 72883db

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

components/Layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import useStore from '~/store';
88
import { SectionContext } from '~/context';
99
import { useTheme } from 'next-themes';
1010
import DarkModeToggle from './DarkModeToggle';
11-
import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment';
1211
import ScrollButton from './ScrollButton';
1312
import Image from 'next/image';
1413

@@ -138,7 +137,7 @@ const MainNavLink = ({
138137
className?: string;
139138
}) => {
140139
const router = useRouter();
141-
const isActiveNav = extractPathWithoutFragment(router.asPath) === uri;
140+
const isActiveNav = router.asPath.startsWith(uri);
142141

143142
return (
144143
<Link

0 commit comments

Comments
 (0)