From d1df6426b2ee89055a07b2c7e514d6fec3d90c86 Mon Sep 17 00:00:00 2001 From: Tom Heaton Date: Fri, 21 Jun 2024 10:21:11 +0100 Subject: [PATCH] cleanup some state and functions --- src/components/Footer/index.jsx | 4 ++-- src/components/Navbar/index.jsx | 10 +++------- src/pages/index.jsx | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx index 461ae54..3507b27 100755 --- a/src/components/Footer/index.jsx +++ b/src/components/Footer/index.jsx @@ -33,7 +33,7 @@ const socials = [ ]; export default function Footer() { - const toggleHome = () => { + const scrollToHome = () => { scroll.scrollToTop(); }; @@ -43,7 +43,7 @@ export default function Footer() { - + Understanding Deep Learning diff --git a/src/components/Navbar/index.jsx b/src/components/Navbar/index.jsx index 8cf38eb..394f80c 100755 --- a/src/components/Navbar/index.jsx +++ b/src/components/Navbar/index.jsx @@ -17,11 +17,7 @@ export default function Navbar({ toggle }) { useEffect(() => { const changeNav = () => { - if (window.scrollY >= 80) { - setScrollNav(true); - } else { - setScrollNav(false); - } + setScrollNav(window.scrollY >= 80); }; window.addEventListener("scroll", changeNav); @@ -31,7 +27,7 @@ export default function Navbar({ toggle }) { }; }, []); - const toggleHome = () => { + const scrollToHome = () => { scroll.scrollToTop(); }; @@ -40,7 +36,7 @@ export default function Navbar({ toggle }) {