-
Notifications
You must be signed in to change notification settings - Fork 1
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
preparando para o review #1
base: main
Are you sure you want to change the base?
Conversation
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.
Olá, Diego!
Aqui embaixo tem algumas recomendações quanto ao seu projeto, mas além disso, gostaria de pontuar algumas coisas:
- Você, talvez por pouco tempo na hora de organizar o projeto, não importou (no backend) os schemas no lugar certo. Por ser uma linha de código, não desconsiderei o projeto todo por isso, apenas fui lá e troquei.
- Seria uma boa você redirecionar o usuário para a home após ele adicionar alguma transação, tornando sua aplicação mais fluída.
Tirando isso, sua aplicação está ótima!
Abraços 😷
function totalCalculation () { | ||
let total = 0; | ||
box.map(item => { | ||
total+= Number(item.box); | ||
}) | ||
return (total) | ||
} |
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.
E se isso viesse do backend como
{
balance: value,
transactions: []
}
useEffect(() => { | ||
if(!user) { | ||
history.push("/") | ||
return("") |
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.
Seu return pode ser um return vazio:
return;
const body = { | ||
transaction: value, | ||
description: description | ||
} |
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.
E se isso já estivesse no useState como um objeto?
event.preventDefault(); | ||
|
||
if(password !== passwordConfirm) { | ||
alert("The confirmation password must be the same as ur password"); |
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.
É uma boa prática não colocar os erros como alertas, assim sua aplicação fica mais fluída com erros no próprio corpo da aplicação.
import { newTransaction } from "../service"; | ||
import UserContext from "../contexts/UserContext"; | ||
|
||
export default function Spending () { |
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.
Esse componente não é similar ao Profit? Como poderíamos torná-lo um componente único?
No description provided.