-
Notifications
You must be signed in to change notification settings - Fork 111
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
C17 - Sea Turtles - Shannon Bellemore #110
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job Shannon! Let me know if you have any questions on what I reviewed.
const [entries, setEntries] = useState(chatMessages); | ||
const [likesTotal, setLikesTotal] = useState(0); | ||
|
||
const changeLikes = (id) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
|
||
const ChatEntry = (props) => { | ||
const likedEntry = () => { | ||
props.changeLikes(props.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job just passing the id and letting the code in App,js handle creating the object.
<TimeStamp time={props.timeStamp} /> | ||
</p> | ||
<button onClick={likedEntry} className="like"> | ||
{props.liked ? '❤️':'🤍'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great use of ternary
import ChatEntry from './ChatEntry'; | ||
|
||
const ChatLog = (props) => { | ||
const chatEntryComponents = props.entries.map((entry) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that you are getting an error about each entry having a unique key. Even though I see you using the entry id on line 9, I would suggest using the index from the map function
const ChatEntryComponents = props.entries.map((entry, index) => {
...
<ChatEntry
key={index}
No description provided.