diff --git a/pages/[username].tsx b/pages/[username].tsx index 3d027042..8af53122 100644 --- a/pages/[username].tsx +++ b/pages/[username].tsx @@ -31,6 +31,11 @@ const ProfileRoute: React.FC = () => { const [raidId, setRaidId] = useState(null) const [recencyInSeconds, setRecencyInSeconds] = useState(null) + useEffect(() => { + window.addEventListener("scroll", handleScroll) + return () => window.removeEventListener("scroll", handleScroll); + }, []) + useEffect(() => { if (username) fetchProfile(username as string) @@ -93,16 +98,6 @@ const ProfileRoute: React.FC = () => { setRecencyInSeconds(null) } - function render() { - const content = (parties && parties.length > 0) ? renderGrids() : renderNoGrids() - return ( -
- - {content} -
- ) - } - function handleScroll() { if (window.pageYOffset > 90) setScrolled(true)