Conversation
jbieniosek
left a comment
There was a problem hiding this comment.
Great work on this project Joanna! Small note, even though JS does not require any particular tab structure, consistent tabs can improve readability. This was very close to passing all tests, removing one extra line from ChatEntry fixed the errors. This project is green.
| }) | ||
| : timeStampMessage(daysSinceMsg)} | ||
| </p> | ||
| <button className="like">🤍</button> |
There was a problem hiding this comment.
Removing this line causes all tests to pass.
| <button className="like">🤍</button> |
| msgStamp = `${yrs} years ago`; | ||
| } | ||
| return msgStamp; | ||
| } |
There was a problem hiding this comment.
I can see that you put a lot of work into this section, but just so you're aware, the Timestamp component that was provided with the project will do all of this work for you and render the correct relative time. It takes the timeStamp from the message data as a prop.
| </p> | ||
| <button className="like">🤍</button> | ||
| <button className="like" onClick={() => toggleLiked(props.id)}> | ||
| {`${props.liked ? '❤️' : '🤍'}`} |
There was a problem hiding this comment.
This can be written slightly simpler:
| {`${props.liked ? '❤️' : '🤍'}`} | |
| {props.liked ? '❤️' : '🤍'} |
Strings inside of {} in JSX will automatically render as text.
| const entries = props.entries; | ||
| console.log(entries); | ||
|
|
||
| const entryLog = entries.map((entry) => { |
| : timeStampMessage(daysSinceMsg)} | ||
| </p> | ||
| <button className="like">🤍</button> | ||
| <button className="like" onClick={() => toggleLiked(props.id)}> |
| : entry; | ||
| }); | ||
| setEntries(newEntries); | ||
| }; |
No description provided.