-
Notifications
You must be signed in to change notification settings - Fork 1
PR para correção e comentários #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: correcao
Are you sure you want to change the base?
Conversation
Criação dos componentes
Ajuste do componente produtos
Ajuste do componente filtro
Ajuste do Componente carrinho
Ajuste para filtrar os itens de acordo com os valores
Primeiros ajustes da funcionalidade do carrinho
future E-commerce
paula-aribeiro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oii pessoal, ficou animal o projeto de vocês!!!
Vocês atenderam todos os requisitos que pedimos, tanto obrigatórios quanto desafios. Também fizeram um código bem componentizado, organizado, usando conceitos que ainda nem ensinamos. Elegante demais!
Uma sugestão de melhoria seria usar propTypes nos componentes, pois por ser um projeto maior pode gerar confusão com as props. Também deixei alguns comentários abaixo.
Continuem assim 🚀 👏
| function App() { | ||
| return ( | ||
| <ContainerEcommerce /> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seria melhor que o App fosse o ContainerEcommerce
| componentDidMount(){ | ||
| const arrCarrinhoStorage = JSON.parse(localStorage.getItem('arrCarrinho')) != null ? JSON.parse(localStorage.getItem('arrCarrinho')) : [] | ||
| const valorCarrinhoStorage = localStorage.getItem('valorCarrinho') != null ? localStorage.getItem('valorCarrinho') : 0.00 | ||
|
|
||
| this.setState({ | ||
| listaCarrinho:arrCarrinhoStorage, | ||
| totalCarrinho:valorCarrinhoStorage | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
| componentDidUpdate(){ | ||
| localStorage.setItem("arrCarrinho",JSON.stringify(this.state.listaCarrinho)) | ||
| localStorage.setItem("valorCarrinho",this.state.totalCarrinho) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Muito bom!
| localStorage.setItem("valorCarrinho",this.state.totalCarrinho) | ||
| } | ||
|
|
||
| filtrarProdutos = (arg1, arg2, arg3) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Esses argumentos poderiam ter nomes mais significativos
| this.setState({ listaCarrinho: listaCarrinhoCopia, | ||
| },()=>{ | ||
| this.atualizarPrecoTotal() | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Booooa 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Não sei onde vocês aprenderam isso, mas parabéns
| if(value==="decrescente"){ | ||
| listaProdutosCopia.sort(function(a,b){ | ||
| return parseFloat(a.price) > parseFloat(b.price) ? -1 : parseFloat(a.price) < parseFloat(b.price) ? 1 : 0 | ||
| }) | ||
| }else if(value==="crescente"){ | ||
| listaProdutosCopia.sort(function(a,b){ | ||
| return parseFloat(a.price) > parseFloat(b.price) ? 1 : parseFloat(a.price) < parseFloat(b.price) ? -1 : 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forma interessante de ordenar!
| this.setState({ | ||
| formControls:{ | ||
| ...this.state.formControls, | ||
| [name]:{ | ||
| ...this.state.formControls[name], | ||
| value | ||
| } | ||
| } | ||
| }, () => {this.props.transporteDeFiltros(this.state.formControls.valorMin.value, | ||
| this.state.formControls.valorMax.value, | ||
| this.state.formControls.filtro.value) | ||
| }); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boa, generalizando a função 👏
| @@ -0,0 +1,43 @@ | |||
| import React from 'react'; | |||
| import { makeStyles } from '@material-ui/core/styles'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parabéns por terem usado o material-ui, que ainda iremos ensinar 😍 👏
No description provided.