mirror of
https://github.com/koreanbots/core.git
synced 2025-12-16 14:30:22 +00:00
feat: remove scroll detection logic in Navbar
This commit is contained in:
parent
486481d5d0
commit
e3e407af67
@ -51,18 +51,11 @@ const Navbar: React.FC<NavbarProps> = ({ token }) => {
|
|||||||
setUserCache(null)
|
setUserCache(null)
|
||||||
}
|
}
|
||||||
}, [token])
|
}, [token])
|
||||||
const [scrolled, setScrolled] = useState(false)
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleScroll = () => setScrolled(window.scrollY > 160)
|
|
||||||
window.addEventListener('scroll', handleScroll)
|
|
||||||
return () => window.removeEventListener('scroll', handleScroll)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='fixed top-0 left-0 right-0 z-50'>
|
<div className='fixed top-0 left-0 right-0 z-50'>
|
||||||
<nav className={`fixed top-0 z-40 flex w-full flex-wrap items-center justify-between px-2 py-2 text-gray-100 transition-colors duration-300 backdrop-blur-sm ${
|
<nav className={`fixed top-0 z-40 flex w-full flex-wrap items-center justify-between px-2 py-2 text-gray-100 transition-colors duration-300 backdrop-blur-sm ${
|
||||||
scrolled || dev ? 'bg-discord-blurple dark:bg-discord-black' : 'bg-discord-blurple/30 dark:bg-discord-black/30'
|
dev ? 'bg-discord-blurple dark:bg-discord-black' : 'bg-discord-blurple/30 dark:bg-discord-black/30'
|
||||||
} lg:absolute`}>
|
} lg:absolute`}>
|
||||||
<div className='container mx-auto flex flex-wrap items-center justify-between px-4'>
|
<div className='container mx-auto flex flex-wrap items-center justify-between px-4'>
|
||||||
<div className='relative flex w-full justify-between lg:w-auto lg:justify-start'>
|
<div className='relative flex w-full justify-between lg:w-auto lg:justify-start'>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user