Skip to content

Conversation

@paula-aribeiro
Copy link

No description provided.

Brian-Mello and others added 25 commits December 5, 2019 11:48
Criei parte estática do menu do carrinho e botão com renderização condicional
criei parte estática do filtro lateral
atualização do app com as fotos implementadas
LojaCarrinho, Produto e MainContainer atualizados
Copy link
Author

@paula-aribeiro paula-aribeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oi pessoal,

Bem bacana o projeto de vocês, mas ficou faltando boa parte das funcionalidades que pedimos.

Sobre o código, vocês componentizaram bastante, mas acredito que vocês poderiam ter separado melhor as responsabilidades de cada componente. Por exemplo, um componente para tratar dos produtos, outro para tratar dos filtros, outro para o carrinho e um que utilizasse todos esses. Além disso, em alguns arquivos vi componentes sendo importados e não utilizados, o que dificultou bastante o entendimento do código.

Parabéns pelo trabalho em equipe e continuem evoluindo 🚀




export default class ProdutosContainer extends React.Component {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uma boa prática é nomear o componente com o mesmo nome da pasta, nesse caso, MainContainer

Comment on lines +7 to +12
const MainContainer = styled.div`
/* border: 1px solid black; */
width: 100%;
height: 650px;
display: flex;
`;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esse styled component deveria ter um nome diferente da pasta, para não confundir no render

Comment on lines +29 to +45
onChangeMin = event => {
this.setState({
valorMinInput: Number(event.target.value)
})
}

onChangeMax = event => {
this.setState({
valorMaxInput: Number(event.target.value)
})
}

onChangeMin = event => {
this.setState({
valorBuscaInput: event.target.value
})
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A função onChangeMin foi criada duas vezes

// const ProdutosFiltrados = this.props.produtos.filter()
return (
<MainContainer>
<FiltroDeProduto/>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acredito que esse componente <FiltroDeProduto/> poderia ter sido chamado fora desse componente ProdutosContainer, pois ele é de outro contexto.

Comment on lines +89 to +92
<Select>
<option>Preço: Crescente</option>
<option>Preço: Decrescente</option>
</Select>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isso poderia fazer parte do componente de filtros

@@ -0,0 +1,83 @@
import React from 'react';
import styled from 'styled-components';
import FiltradosPorPreco from '../FiltroDeProduto/FiltradosPorPreco'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O FiltradosPorPreco foi importado mas não foi utilizado

constructor(props) {
super(props);
this.state = {
listaCarrinho1: []
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por que listaCarrinho1 e não apenas listaCarrinho?


render() {
const listaDeItensNoCarrinho = this.props.listaCarrinho2.map((cadaItem) => {
return <ItemProduto><ExcluirItem>X</ExcluirItem>{cadaItem.nome} - R$ {cadaItem.valor},00</ItemProduto>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cuidado que isso não funcionaria para valores quebrados! Nesse caso, seria melhor utilizar

{cadaItem.valor.toFixed(2)}

const listaDeItensNoCarrinho = this.props.listaCarrinho2.map((cadaItem) => {
return <ItemProduto><ExcluirItem>X</ExcluirItem>{cadaItem.nome} - R$ {cadaItem.valor},00</ItemProduto>
})
console.log(listaDeItensNoCarrinho)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evite deixar console.log pelo código

Comment on lines +83 to +85
<p>
Total: <b>R$ 0,00</b>
</p>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isso está estático

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants