Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

sharks- jeannie #105

wants to merge 1 commit into from

Conversation

jeanniezheng
Copy link

No description provided.

Comment on lines +12 to +15
const entries = messageData.map((message) => {
if (message.id === messageToUpdate.id) {
return messageToUpdate
}
Copy link

@spitsfire spitsfire Jun 28, 2022

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')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log('updating heart')

Comment on lines +19 to +22
sender: sender,
body: body,
timeStamp: timeStamp,
id: id,

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 }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +9 to +13
if (isLiked) {
console.log('is liked');
} else {
console.log('is unliked');
}

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

Suggested change
if (isLiked) {
console.log('is liked');
} else {
console.log('is unliked');
}

import chatMessages from './data/messages.json';

import ChatLog from './components/ChatLog'
const App = () => {

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 }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants