Run prettier

This commit is contained in:
Jared Palmer 2023-06-02 15:33:48 -04:00
parent aa83a871dd
commit 417f69e0f1
34 changed files with 530 additions and 523 deletions

View file

@ -1,16 +1,16 @@
import { useCallback, useEffect, useState } from "react";
import { useCallback, useEffect, useState } from 'react'
export default function useScroll(threshold: number) {
const [scrolled, setScrolled] = useState(false);
const [scrolled, setScrolled] = useState(false)
const onScroll = useCallback(() => {
setScrolled(window.pageYOffset > threshold);
}, [threshold]);
setScrolled(window.pageYOffset > threshold)
}, [threshold])
useEffect(() => {
window.addEventListener("scroll", onScroll);
return () => window.removeEventListener("scroll", onScroll);
}, [onScroll]);
window.addEventListener('scroll', onScroll)
return () => window.removeEventListener('scroll', onScroll)
}, [onScroll])
return scrolled;
return scrolled
}