Skip to content

Conversation

@JoannaOpera
Copy link

No description provided.

Copy link

@jbieniosek jbieniosek left a 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.

})
: timeStampMessage(daysSinceMsg)}
</p>
<button className="like">🤍</button>

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.

Suggested change
<button className="like">🤍</button>

msgStamp = `${yrs} years ago`;
}
return msgStamp;
}

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.

</p>
<button className="like">🤍</button>
<button className="like" onClick={() => toggleLiked(props.id)}>
{`${props.liked ? '❤️' : '🤍'}`}

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:

Suggested change
{`${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) => {

Choose a reason for hiding this comment

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

👍

: timeStampMessage(daysSinceMsg)}
</p>
<button className="like">🤍</button>
<button className="like" onClick={() => toggleLiked(props.id)}>

Choose a reason for hiding this comment

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

💯

: entry;
});
setEntries(newEntries);
};

Choose a reason for hiding this comment

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

Great callback function!

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