-
Notifications
You must be signed in to change notification settings - Fork 111
Alexa Coffman - Whales #94
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
base: main
Are you sure you want to change the base?
Conversation
kaidamasaki
left a comment
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!
I left one note about semantic HTML but everything else looks good.
Well done!
| import ChatLog from './components/ChatLog'; | ||
| import chatMessages from './data/messages.json'; | ||
|
|
||
| let totalLikes = 0; |
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.
totalLikes should have been stored in a useState variable.
When you update state in React it triggers a re-render automatically. Updating a global variable won't. (Also if you instantiated the app twice on the same page you'd be in trouble.)
| <h1>Application title</h1> | ||
| <h1>Chat between Vladimir and Estragon</h1> | ||
| <section className="header section"> | ||
| <h4 id="heartWidget" className="widget"> |
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.
Remember, the h1, h2, etc. elements should be used to denote the structure of the page (you should be able to build a table of contents).
If you want to change the size of text you should use CSS.
| <section> | ||
| <ChatEntry | ||
| id={chatEntry.id} | ||
| sender={chatEntry.sender} | ||
| body={chatEntry.body} | ||
| timeStamp={chatEntry.timeStamp} | ||
| liked={chatEntry.liked} | ||
| onUpdate={props.onUpdateEntry} | ||
| ></ChatEntry> | ||
| </section> |
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 extra section doesn't hurt anything but isn't required, FYI.
No description provided.