From 3a5dbf53f3abf37f1e28563a23b39964f647193e Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 14 Dec 2022 21:58:56 -0300 Subject: [PATCH] feat: adiciona progress bar js --- checkout/src/arquivos/js/components/Header.js | 20 +++++-- .../src/arquivos/js/helpers/HashRouter.js | 1 + .../src/arquivos/sass/partials/_header.scss | 59 +++++++++++++++---- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/checkout/src/arquivos/js/components/Header.js b/checkout/src/arquivos/js/components/Header.js index be8396c..ce203da 100644 --- a/checkout/src/arquivos/js/components/Header.js +++ b/checkout/src/arquivos/js/components/Header.js @@ -1,5 +1,6 @@ // import waitForEl from "../helpers/waitForEl"; import { waitElement } from "m3-utils"; +import HashRouter from "../helpers/HashRouter"; export default class Header { constructor() { @@ -13,6 +14,7 @@ export default class Header { } async selectors() { + window.addEventListener("hashchange", this.addProgressBar.bind(this)); this.item = await waitElement("#my-element", { //#my-element pode ser a class ou o id do elemento html qeu vocÊ quer pegar timeout: 5000, // vai esperar 5 segundos antes de rejeitar a promise @@ -26,15 +28,23 @@ export default class Header { this.progressBar.innerHTML = `

progress

`; console.log("dasdsdas"); } */ + const url = window.location.hash; progressBar.innerHTML = ` -