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

React-Chatlog-Marlyn-C17 #97

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

React-Chatlog-Marlyn-C17 #97

wants to merge 3 commits into from

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