From db748daa314706979aa9a314dbe3c9aa69077d65 Mon Sep 17 00:00:00 2001 From: Patrick Souza Date: Tue, 20 Dec 2022 22:05:08 -0300 Subject: [PATCH] feat adicionando css ao slick e corrigindo bugs --- checkout/src/arquivos/js/components/Footer.js | 26 +++++- checkout/src/arquivos/sass/checkout.scss | 1 + .../sass/checkout/_checkout-vazio.scss | 15 ---- .../src/arquivos/sass/checkout/_checkout.scss | 13 +-- checkout/src/arquivos/sass/lib/_slick.scss | 56 +------------ .../src/arquivos/sass/partials/_footer.scss | 57 ++++++++++++- .../src/arquivos/sass/partials/_header.scss | 6 ++ .../arquivos/sass/partials/_prateleira.scss | 82 +++++++++++++++++++ 8 files changed, 169 insertions(+), 87 deletions(-) diff --git a/checkout/src/arquivos/js/components/Footer.js b/checkout/src/arquivos/js/components/Footer.js index 7b5a68f..052b583 100644 --- a/checkout/src/arquivos/js/components/Footer.js +++ b/checkout/src/arquivos/js/components/Footer.js @@ -11,6 +11,7 @@ export default class Footer { this.addPaymentsIcons(); this.addPciIcons(); this.onUpdateShelf(); + this.addVtexIcon(); } async selectors() { @@ -20,6 +21,10 @@ export default class Footer { this.paymentIconsContainer = await waitElement(".footerCheckout__payments"); this.iconPci = await waitElement(".footerCheckout__vtexpci"); this.shelfContainer = $(".footerCheckout__prateleira"); + this.footer = $(".footerCheckout"); + this.vtexIcon = $("a[href='https://vtex.com/br-pt/']"); + this.m3Icon = $("a[href='https://agenciam3.com/']"); + this.titleFooter = $(".footer-title"); } onUpdate() { @@ -29,9 +34,12 @@ export default class Footer { let target = this.checkoutVazio; let config = { attributes: true }; let observer = new MutationObserver((mutations) => { - mutations.forEach((mutation) => { + mutations.forEach(() => { if (target.style.display === "block") { + console.log(this.titleFooter); this.shelfContainer.empty(); + this.titleFooter.remove(); + $(".slick-slider").removeClass("slick-slider slick-initialized"); } else { this.createShelf(); @@ -65,6 +73,7 @@ export default class Footer { if (hash !== "cart") { this.shelfContainer.empty(); + this.titleFooter.remove(); $(".slick-slider").removeClass("slick-slider slick-initialized"); } else { this.createShelf(); @@ -128,6 +137,17 @@ export default class Footer { this.iconPci.innerHTML = html; } } + addVtexIcon() { + const logoM3Academy = `Developed By + + `; + + const logoVtex = `Powered By + `; + + this.vtexIcon.html(logoVtex); + this.m3Icon.html(logoM3Academy); + } async createShelf() { const data = await fetch( @@ -135,6 +155,7 @@ export default class Footer { ); const products = await data.json(); const hash = window.location.hash.replace("#/", ""); + const shelfTitle = ``; const html = products.map( (product) => ` @@ -144,7 +165,7 @@ export default class Footer { }> ${product.productName}
- ${product.items.map((item) => ``)} + ${product.items.map((item) => ``).join(",")}