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

Tigers-Samiya-Chatlog #126

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

Tigers-Samiya-Chatlog #126

wants to merge 3 commits into from

Conversation

SamiyaOI96
Copy link

My vs code was not working with the tests so i had to alter them to be single quotes. I didn't really know what to do so changed the test bc VS code was not happy!

Copy link

@apradoada apradoada left a comment

Choose a reason for hiding this comment

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

YELLOW! Overall this is a really good start, Samiya! The one glaring issue that keeps this from being a green is that you don't ever modify the messages list. You can toggle the heart front end, and you have found a workaround to make it count the number of likes. However, the actual information itself is never changed on the message's end.

setLikeCount(likesCount-1)

}
}

Choose a reason for hiding this comment

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

This is a good start. However, your program is only changing the state of the likesCount and doesn't ever address the chatMessages. When you change the buttons, the likes will change visually, but each message's backend data will remain unchanged.

</header>
<main>
{/* Wave 01: Render one ChatEntry component
<ChatLog entries={chatMessages}updateLikes={updateLikes}

Choose a reason for hiding this comment

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

Well done passing parameters via props!

setLikeButton('🤍')
props.updateLikes(false)
}
}

Choose a reason for hiding this comment

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

Here is where you could have used the state that you pass in to handle what your output is. For example, if we had a props parameter called "isLiked," we could have used that in a simple ternary operator to spit out either the liked heart or the unliked heart.

body:PropTypes.string.isRequired,
timeStamp:PropTypes.string.isRequired,
likes:PropTypes.bool.isRequired,

};

Choose a reason for hiding this comment

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

Great use of proptypes here!

<p className="entry-time">
<TimeStamp time={props.timeStamp}/>
</p>
<button className="like" onClick={clickedToggle}>{likeButton}</button>

Choose a reason for hiding this comment

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

emember that we have passed down a function that is supposed to handle this for us. If we are having to rewrite this function, we aren't effectively lifting state up.


);
};

Choose a reason for hiding this comment

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

Missing our proptypes! Other than that, this component is well-written!

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