feat: Fazendo o menu mobile/tablet fechar ao clicar fora

This commit is contained in:
José Carlos Lins 2022-12-30 15:53:47 -03:00
parent 35d1596ac1
commit 89a84c9c95
2 changed files with 12 additions and 2 deletions

View File

@ -27,6 +27,10 @@ export const MenuToggle = ({
</div>
<MenuNav />
</div>
<div
onClick={() => setShowMenuToggle((prev) => !prev)}
className={styles.closeMenu}
></div>
</div>
) : null}
</>

View File

@ -7,9 +7,8 @@
left: 0;
z-index: 50;
background: rgba(69, 69, 69, 0.7);
.contentMenuToogle {
position: absolute;
width: 96.4843%;
height: 585px;
@ -43,6 +42,13 @@
}
}
}
.closeMenu {
width: 100%;
height: 100vh;
background: rgba(69, 69, 69, 0.7);
}
}
@media screen and (max-width: 540px) {