Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ninidora
Copy link

No description provided.

Copy link
Author

@ninidora ninidora left a 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 😷

Comment on lines -22 to -28
function totalCalculation () {
let total = 0;
box.map(item => {
total+= Number(item.box);
})
return (total)
}
Copy link
Author

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("")
Copy link
Author

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;

Comment on lines -24 to -27
const body = {
transaction: value,
description: description
}
Copy link
Author

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");
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 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 () {
Copy link
Author

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?

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.

1 participant