feat(Footer.js): implementação das imagens e logos no footer

This commit is contained in:
Ramon Dias Ferreira 2022-12-16 15:19:27 -03:00
parent b4761dc6f0
commit 2346a5f5e6

View File

@ -3,19 +3,19 @@ import { waitElement } from "m3-utils";
export default class Footer { export default class Footer {
constructor() { constructor() {
this.init(); this.init();
} }
async init() { async init() {
this.list = await this.requestApi(); this.list = await this.requestApi();
await this.selectors(); await this.selectors();
this.creditCardIconsHTML();
this.developedByIconsHTML();
// this.onUpdate(); // this.onUpdate();
this.createShelf(); this.createShelf();
this.shelfList = await waitElement(".footerCheckout__shelfList"); this.shelfList = await waitElement(".footerCheckout__shelfList");
this.shelfItens(); this.shelfItens();
this.addCarrossel(); this.addCarrossel();
} }
@ -24,6 +24,13 @@ export default class Footer {
timeout: 5000, timeout: 5000,
interval: 1000, interval: 1000,
}); });
this.checkoutVazio = await waitElement(".empty-cart-content", {
timeout: 5000,
interval: 1000,
});
this.creditCardIcons = await waitElement(".footerCheckout__stamps");
this.developedByIcons = await waitElement(".footerCheckout__developedBy");
} }
createShelf() { createShelf() {
@ -95,4 +102,47 @@ export default class Footer {
infinite: false, infinite: false,
}); });
} }
creditCardIconsHTML() {
this.creditCardIcons.innerHTML = `
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/masterCardM3Academy.png" alt="Mastercard"></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/visaM3Academy.png" alt=""></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/amexM3Academy.png" alt="American Express"></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/eloM3Academy.png" alt="Elo"></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/hiperCardM3Academy.png" alt="Hipercard"></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/payPalM3Academy.png" alt="PayPal"></li>
<li><img src="https://agenciamagma.vteximg.com.br/arquivos/boletoM3Academy.png" alt="Boleto"></li>
<li><span class="footerCheckout__stamps__divider"></span></li>
<li class="vtex-pci"><img src="https://agenciamagma.vteximg.com.br/arquivos/vtexPCIM3Academy.png" alt="PCI VTEX"></li>
`;
} }
developedByIconsHTML() {
this.developedByIcons.innerHTML = `
<li>
<div class="by-vtex">
<a href="https://vtex.com.br-pt/">
<span>Powered By</span>
</a>
<img class="vtex-logo" src="https://agenciamagma.vteximg.com.br/arquivos/logoVTEXM3Academy.png" alt="VTEX" />
</div>
</li>
<li>
<div class="by-m3">
<a href="https://vtex.com.br-pt/">
<span>Developed By</span>
</a>
<img class="m3-logo" src="https://agenciamagma.vteximg.com.br/arquivos/logoM3M3Academy.png" alt="M3" />
</div>
</li>
`;
}
}