diff --git a/frontend/src/components/ScrollToTop.jsx b/frontend/src/components/ScrollToTop.jsx index e282c569..762219e7 100644 --- a/frontend/src/components/ScrollToTop.jsx +++ b/frontend/src/components/ScrollToTop.jsx @@ -5,20 +5,16 @@ import { ArrowUp } from "lucide-react"; const ScrollToTop = () => { const [isVisible, setIsVisible] = useState(false); const location = useLocation(); + // Hide the button on login and root pages + const isLoginPage = + location.pathname === "/login" || location.pathname === "/"; - // Hide the button on login and root pages - const isLoginPage = location.pathname === "/login" || location.pathname === "/"; - - // Toggle visibility based on scroll position + // Toggle visibility based on scroll position + //little changed const toggleVisibility = () => { - if (window.scrollY > 100) { - setIsVisible(true); - } else { - setIsVisible(false); - } + setIsVisible(window.scrollY > 100); }; - - // Scroll to top function +// Scroll to top function const scrollToTop = () => { window.scrollTo({ top: 0, @@ -48,7 +44,8 @@ const ScrollToTop = () => { if (isLoginPage) return null; return ( -
+ /* FIXED */ +
{shouldShow && (