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

Ruby- Mikayla H #68

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Ruby- Mikayla H #68

wants to merge 5 commits into from

Conversation

MDHowden2020
Copy link

No description provided.

Copy link

@nancy-harris nancy-harris left a 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 = {

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,
})
),

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'

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

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

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(

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

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

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

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.

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