-
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
sharks- jeannie #105
base: main
Are you sure you want to change the base?
sharks- jeannie #105
Conversation
const entries = messageData.map((message) => { | ||
if (message.id === messageToUpdate.id) { | ||
return messageToUpdate | ||
} |
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.
hmm I'm a little confused by this if statement and variable. I don't see you using entries
anywhere. Do you need this? It doesn't look like you are updating messageData
, only checking to see if messagesToUpdate
"exists" in order to add likes.
I think all you need is lines 16-22
} | ||
|
||
const updateLiked = () => { | ||
console.log('updating heart') |
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.
console.log('updating heart') |
sender: sender, | ||
body: body, | ||
timeStamp: timeStamp, | ||
id: 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.
hmm you are giving this function a lot of editing power when it only needs to update the isLiked
property. Think about giving the function access only to isLiked
.
import ChatEntry from './ChatEntry'; | ||
import './ChatLog.css'; | ||
|
||
const ChatLog = ({ entries, id, liked, onUpdateMessage }) => { |
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.
👍
if (isLiked) { | ||
console.log('is liked'); | ||
} else { | ||
console.log('is unliked'); | ||
} |
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.
Don't forget to get rid of debugging comments once you're ready to submit the final submission
if (isLiked) { | |
console.log('is liked'); | |
} else { | |
console.log('is unliked'); | |
} |
import chatMessages from './data/messages.json'; | ||
|
||
import ChatLog from './components/ChatLog' | ||
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.
👍
import './ChatEntry.css'; | ||
import PropTypes from 'prop-types'; | ||
import TimeStamp from './TimeStamp'; | ||
|
||
const ChatEntry = ({ sender, body, liked, timeStamp, id, onUpdateMessage }) => { |
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.
👍
No description provided.