diff --git a/components/Navbar.tsx b/components/Navbar.tsx index c86d80d..d0d5080 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -11,6 +11,7 @@ import { useEffect, useState } from 'react' import { Nullable, User, UserCache } from '@types' import Fetch from '@utils/Fetch' import { redirectTo } from '@utils/Tools' +import Search from './Search' const DiscordAvatar = dynamic(() => import('@components/DiscordAvatar')) @@ -51,9 +52,20 @@ const Navbar: React.FC = ({ token }) => { setUserCache(null) } }, [token]) + const [scrolled, setScrolled] = useState(false) + + useEffect(() => { + const handleScroll = () => setScrolled(window.scrollY > 80) + window.addEventListener('scroll', handleScroll) + return () => window.removeEventListener('scroll', handleScroll) + }, []) + return ( - <> -