This commit is contained in:
2024-10-08 15:16:41 +08:00
parent b9c5a7096a
commit ae470a2e83
3 changed files with 9 additions and 17 deletions

View File

@@ -15,23 +15,9 @@ type Props = {
settings: SettingsProps
}
const Nav = ({ openNav, courses, showNav, settings }: Props) => {
const [navBg, setNavBg] = useState(false)
const [dropdownOpen, setDropdownOpen] = useState(false);
useEffect(() => {
const handler = () => {
if (window.scrollY >= 90) {
setNavBg(true)
} else if (window.scrollY <= 90) {
setNavBg(false)
}
}
window.addEventListener("scroll", handler)
return () => {
window.removeEventListener("scroll", handler)
}
}, []);
return (
<div className={`bg-[#F6E5E9] max-sm:bg-[#FFF9F9] h-[7vh] z-[10] w-full transition-all duration-200 `}>