Skip to content

Commit

Permalink
Arrumando link de produto na página principal
Browse files Browse the repository at this point in the history
  • Loading branch information
viniddantas committed Jan 3, 2025
1 parent 6265d56 commit 3f3a19c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions assets/css/detalhesProdutos.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
flex-wrap: wrap;
gap: 1rem;
justify-content: space-between;
overflow: hidden;
}
.produtos__item {
min-width: 150px;

}
.produto__imagem {
width: calc((100vw - 3rem)/2);
Expand Down
2 changes: 1 addition & 1 deletion js/controller/listaProduto-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function constroiProduto(id, url, nome, preco) {
<div class="produto__informacoes">
<p class="produto__nome">${nome}</p>
<h3 class="produto__preco">R$${preco}</h3>
<a class="produto__link" href="../pages/detalhesProduto.html?id=${id}">Ver produto</a>
<a class="produto__link" href="./pages/detalhesProduto.html?id=${id}">Ver produto</a>
</div>
`
produto.dataset.id = id
Expand Down
2 changes: 1 addition & 1 deletion js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ listas.forEach((lista) => {
const dados = await conectaApi.buscaVideo(id)
var dadosCodificados = encodeURIComponent(JSON.stringify(dados));

window.location.href = '/pages/detalhesProduto.html?dados=' + dadosCodificados;
window.location.href = './pages/detalhesProduto.html?dados=' + dadosCodificados;
}
})
})
Expand Down

0 comments on commit 3f3a19c

Please sign in to comment.