fix(HeaderBotom): Conserta o overflow hidden do menu #9

Merged
NicollyVieira merged 1 commits from feature/header into development 2023-01-07 17:42:26 +00:00
2 changed files with 13 additions and 12 deletions

View File

@ -6,21 +6,21 @@ import styles from "./Header.module.scss";
const Header = () => {
const [isOpen, setIsOpen] = useState(false);
const resizeWindow = () => {
window.addEventListener("resize", () => {
if(window.innerWidth > 1024) {
document.body.style.overflowY = "auto";
}
});
};
useEffect(() => {
resizeWindow();
})
window.addEventListener("resize", () => {
if (window.innerWidth > 1024) {
document.body.style.overflowY = "auto";
}
if (window.innerWidth <= 1024 && isOpen) {
document.body.style.overflowY = "hidden";
} else {
document.body.style.overflowY = "auto";
}
});
});
return (
<header id="home" className={styles["header"]}>
<header className={styles["header"]}>
<HeaderTop isOpen={isOpen} setIsOpen={setIsOpen} />
<HeaderBottom isOpen={isOpen} setIsOpen={setIsOpen} />
</header>

View File

@ -5,6 +5,7 @@
background: $black;
padding: 14px 100px;
z-index: 20;
@include mq($lg, max) {
position: absolute;