Skip to content

Commit 5f14a04

Browse files
committed
Set navbar style on initial load
1 parent b4bd5a6 commit 5f14a04

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/components/Navbar/Navbar.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export default function Navbar() {
2020
};
2121

2222
useEffect(() => {
23+
if (window.scrollY === 0) {
24+
setIsScrolledToTop(true);
25+
}
2326
window.addEventListener('scroll', handleScroll);
2427
return () => {
2528
window.removeEventListener('scroll', handleScroll);

0 commit comments

Comments
 (0)