Skip to content

Conversation

@marlopez24
Copy link

No description provided.

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

Great job!

I left one really small comment but everything else looks good!

Well done!

Comment on lines +15 to +24
const newChatEntries = chatEntries.map((chatEntry) => {
const newChatEntry = { ...chatEntry };
if (newChatEntry.id === id) {
newChatEntry.liked = !newChatEntry.liked;
}
if (newChatEntry.liked === true) {
likesCount += 1;
}
return newChatEntry;
});

Choose a reason for hiding this comment

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

Nice job making a deep copy using map.

Comment on lines +7 to +14
const ChatEntry = ({
id,
sender,
body,
timeStamp,
liked,
likesCountCallBack,
}) => {

Choose a reason for hiding this comment

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

Nice use of destructuring in the argument list! 🙂

Comment on lines +22 to +24
<div>
<ul> {chatComponents} </ul>
</div>

Choose a reason for hiding this comment

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

Style: I can't remember if the styles need it, but you don't need a surrounding div since you already have a surrounding ul.

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.

2 participants