forked from M3-Academy/desafio-react-e-typescript
fix: Consertando menu footer Tablet/Mobile
This commit is contained in:
parent
0867405cd4
commit
cdbeea7718
@ -21,45 +21,59 @@ export default function FooterTop() {
|
||||
});
|
||||
|
||||
const footerLinkToggle = (e: any) => {
|
||||
const textH2OnClick = e.target.textContent;
|
||||
|
||||
if (window.screen.width <= 1024) {
|
||||
if (e.target.textContent === "Institucional" && !openList.institucional) {
|
||||
if (textH2OnClick === "Institucional" && !openList.institucional) {
|
||||
titleMenuFooter.institucional.current?.classList.add(
|
||||
`${styles.titleActive}`
|
||||
);
|
||||
footerLinks.institucional.current?.classList.add(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, institucional: true }));
|
||||
} else {
|
||||
return setOpenList((prevState) => ({
|
||||
...prevState,
|
||||
institucional: true,
|
||||
}));
|
||||
} else if (textH2OnClick === "Institucional" && openList.institucional) {
|
||||
titleMenuFooter.institucional.current?.classList.remove(
|
||||
`${styles.titleActive}`
|
||||
);
|
||||
footerLinks.institucional.current?.classList.remove(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, institucional: false }));
|
||||
return setOpenList((prevState) => ({
|
||||
...prevState,
|
||||
institucional: false,
|
||||
}));
|
||||
}
|
||||
|
||||
if (e.target.textContent === "Dúvidas" && !openList.duvidas) {
|
||||
if (textH2OnClick === "Dúvidas" && !openList.duvidas) {
|
||||
titleMenuFooter.duvidas.current?.classList.add(`${styles.titleActive}`);
|
||||
footerLinks.duvidas.current?.classList.add(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, duvidas: true }));
|
||||
} else {
|
||||
return setOpenList((prevState) => ({ ...prevState, duvidas: true }));
|
||||
} else if (textH2OnClick === "Dúvidas" && openList.duvidas) {
|
||||
titleMenuFooter.duvidas.current?.classList.remove(
|
||||
`${styles.titleActive}`
|
||||
);
|
||||
footerLinks.duvidas.current?.classList.remove(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, duvidas: false }));
|
||||
return setOpenList((prevState) => ({ ...prevState, duvidas: false }));
|
||||
}
|
||||
|
||||
if (e.target.textContent === "Fale Conosco" && !openList.faleConosco) {
|
||||
if (textH2OnClick === "Fale Conosco" && !openList.faleConosco) {
|
||||
titleMenuFooter.faleConosco.current?.classList.add(
|
||||
`${styles.titleActive}`
|
||||
);
|
||||
footerLinks.faleConosco.current?.classList.add(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, faleConosco: true }));
|
||||
} else {
|
||||
return setOpenList((prevState) => ({
|
||||
...prevState,
|
||||
faleConosco: true,
|
||||
}));
|
||||
} else if (textH2OnClick === "Fale Conosco" && openList.faleConosco) {
|
||||
titleMenuFooter.faleConosco.current?.classList.remove(
|
||||
`${styles.titleActive}`
|
||||
);
|
||||
footerLinks.faleConosco.current?.classList.remove(`${styles.active}`);
|
||||
setOpenList((prevState) => ({ ...prevState, faleConosco: false }));
|
||||
return setOpenList((prevState) => ({
|
||||
...prevState,
|
||||
faleConosco: false,
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -118,15 +132,14 @@ export default function FooterTop() {
|
||||
<span className={styles.titleSuportClient}>
|
||||
Atendimento Ao Consumidor
|
||||
</span>
|
||||
<span
|
||||
className={styles.numberSuportClient}
|
||||
>{`(11) 4159 9504`}</span>
|
||||
<a href="tel:114159-9504">{`(11) 4159 9504`}</a>
|
||||
</li>
|
||||
<li className={styles.supportClient}>
|
||||
<span className={styles.titleSuportClient}>Atendimento Online</span>
|
||||
<span
|
||||
className={styles.numberSuportClient}
|
||||
>{`(11) 99433-8825`}</span>
|
||||
<a
|
||||
href="tel:1199433-8825"
|
||||
className={styles.numberDecoration}
|
||||
>{`(11) 99433-8825`}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -24,6 +24,10 @@
|
||||
margin-top: 12px;
|
||||
|
||||
color: var(--black-100);
|
||||
|
||||
&:last-child {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.containerSupportClient {
|
||||
@ -31,10 +35,16 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
text-decoration: none;
|
||||
|
||||
.titleSuportClient {
|
||||
margin-bottom: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.numberDecoration {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
input {
|
||||
margin: 12px 0;
|
||||
height: 46px;
|
||||
|
||||
border: 1px solid #100d0e;
|
||||
border-radius: 25px;
|
||||
|
Loading…
x
Reference in New Issue
Block a user