Skip to content

Commit 7155d01

Browse files
fixed navbar bug on projects page
1 parent 6736c72 commit 7155d01

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/components/ui/NavigationBar.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const HoverNavigation = ({
6363
}, [items]);
6464

6565
useEffect(() => {
66+
// hamburger stuff
6667
const handleClickOutside = (event: MouseEvent) => {
6768
if (
6869
hamburgerOpen &&
@@ -75,6 +76,13 @@ export const HoverNavigation = ({
7576
}
7677
};
7778

79+
// set hover index on projects when on "/projects"
80+
const splittedURL = window.location.href.split("/");
81+
82+
if (splittedURL[splittedURL.length - 1]) {
83+
setHoveredIndex(2);
84+
}
85+
7886
document.addEventListener("mousedown", handleClickOutside);
7987
return () => {
8088
document.removeEventListener("mousedown", handleClickOutside);

0 commit comments

Comments
 (0)