-
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
Seattle Otters - Joanna #108
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 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.
minute: '2-digit', | ||
}) | ||
: timeStampMessage(daysSinceMsg)} | ||
</p> | ||
<button className="like">🤍</button> |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
<button className="like">🤍</button> | ||
<button className="like" onClick={() => toggleLiked(props.id)}> | ||
{`${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.
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) => { |
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.
👍
<button className="like">🤍</button> | ||
<button className="like" onClick={() => toggleLiked(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.
💯
: entry; | ||
}); | ||
setEntries(newEntries); | ||
}; |
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 callback function!
No description provided.