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

PR de correção. Não preicisa mergeear. #5

Open
wants to merge 11 commits into
base: correcao-projeto
Choose a base branch
from

Conversation

pedro-severo
Copy link

PR de correção. Não preicisa mergeear.

whatslab-group7n.surge.sh

Comment on lines +53 to +59
background-color: ${props =>{
if(props.side !== "right"){
return "#ffffff"
} else {
return "#d5f5bc"
}
}};
Copy link
Author

Choose a reason for hiding this comment

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

Mto bom as props no styled-component! Parabéns!

Comment on lines +81 to +85
state = {
mensagensDoApp : [],
valorInputUsuario: "",
valorInputMensagem: ""
};
Copy link
Author

Choose a reason for hiding this comment

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

Perfeita a declaração do estado! 👏👏👏


const novasMensagens = [...this.state.mensagensDoApp, novaMensagem];

this.setState({ mensagensDoApp: novasMensagens, valorInputMensagem: "", valorInputUsuario: ""});
Copy link
Author

Choose a reason for hiding this comment

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

Lembrem-se de quebrar a linha para cada mudança de estado. O código fica mais legível quando se faz isso!

const novasMensagens = [...this.state.mensagensDoApp, novaMensagem];

this.setState({ mensagensDoApp: novasMensagens, valorInputMensagem: "", valorInputUsuario: ""});
console.log(this.state.mensagensDoApp)
Copy link
Author

Choose a reason for hiding this comment

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

Lembrem-se de tirar os console.logs ao longo do código.

let userStyle


let listaMensagens = this.state.mensagensDoApp.map((message) => {
Copy link
Author

Choose a reason for hiding this comment

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

De preferência para const no lugar de let, nesses casos.

Comment on lines +123 to +124
let side
let userStyle
Copy link
Author

Choose a reason for hiding this comment

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

Acho que vocês poderiam ter deixado essas duas lets dentro da função map, pq vcs estão usando elas apenas dentro da função.

Comment on lines +129 to +136
const deleteMsg = () => {
this.deleteMensagem(message.id)
}

if(message.usuario === 'eu'){
side = "right"
return(
<MsgContainer key={message.id} side={side} onDoubleClick={deleteMsg}>
Copy link
Author

Choose a reason for hiding this comment

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

No lugar da criar uma outra função chamada deleteMsg que chama a this.deleteMensagem(message.id), vcs poderiam simplificar a sintaxe no onDoubleClick:

onDoubleClick={() => this.deleteMensagem(message.id)}

Comment on lines +160 to +164
<InputUserName
type="text"
placeholder="usuário"
value={this.state.valorInputUsuario}
onChange={this.onChangeInputUsuario} />
Copy link
Author

Choose a reason for hiding this comment

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

Atenção com a identação. De uma margem nas props do componente.

@pedro-severo
Copy link
Author

Queridos! Fiz uns comentários ao longo do código, peço que deem uma olhada.

Mas no geral, a entrega de vcs ficou impecável. Código muito bem escrito, com desafios feitos e ótimas ideias de lógica para as funcionalidades.

Parabéns! Continuem assim!

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.

3 participants