-
Notifications
You must be signed in to change notification settings - Fork 626
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
Ruby- Mikayla H #68
base: main
Are you sure you want to change the base?
Ruby- Mikayla H #68
Conversation
…lay an entire chat log
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.
Excellent job! There are some comments below on places to make the code cleaner/simpler. Make sure to commit more often. Great job!
export default ChatLog; | ||
|
||
|
||
ChatLog.propTypes = { |
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.
Yay, prop types!
timeStamp: PropTypes.string.isRequired, | ||
liked: PropTypes.bool.isRequired, | ||
}) | ||
), |
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 to add an .isRequired
here or else the entries
prop is not required!
import React from 'react'; | ||
import ChatEntry from './ChatEntry'; | ||
import PropTypes from 'prop-types' | ||
|
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 would be a great place to add the ChatLog.css import!
</section> | ||
</div> | ||
); | ||
}; | ||
|
||
|
||
ChatEntry.propTypes = { |
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.
Yay, prop types! It would be good to make sure all of the props are here (like id).
@@ -1,22 +1,34 @@ | |||
import React from 'react'; | |||
import './ChatEntry.css'; | |||
import PropTypes from 'prop-types'; | |||
import TimeStamp from './TimeStamp' | |||
|
|||
|
|||
const ChatEntry = (props) => { |
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.
Excellent!
|
||
setEntries(updatedEntries); | ||
} | ||
const newLikedCount = entries.filter( |
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.
Minor note: this line is not indented correctly.
|
||
const App = () => { | ||
|
||
const [entries, setEntries] = useState(chatMessages); |
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.
Yay, state!
//use state | ||
// create func to update likes | ||
//creat func to count likes | ||
|
||
|
||
const App = () => { |
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.
Excellent!
@@ -1,19 +1,49 @@ | |||
import React from 'react'; | |||
import './App.css'; | |||
import chatMessages from './data/messages.json'; | |||
import ChatEntry from './components/ChatEntry'; |
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 import is not needed! It's best practice to remove unused imports before submitting projects.
No description provided.