Update scroll threshold in ScrollToTop component

This commit is contained in:
dertyp7
2024-01-13 18:16:49 +01:00
parent 17ad4de822
commit d93e8bc250

View File

@@ -5,7 +5,7 @@ export default function ScrollToTop() {
const [isScrolledUp, setIsScrolledUp] = useState(false); const [isScrolledUp, setIsScrolledUp] = useState(false);
const toggleVisibilityAndDirection = () => { const toggleVisibilityAndDirection = () => {
if (window.scrollY < 150) { if (window.scrollY < 100) {
setIsScrolledUp(false); setIsScrolledUp(false);
} else { } else {
setIsScrolledUp(window.scrollY === 0 ? false : true); setIsScrolledUp(window.scrollY === 0 ? false : true);