Skip to content

Conversation

@amythetester
Copy link

React Timeline

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
Explain what purpose a component serves in React?
How does adding dynamic content to a web page in React compare to jQuery?
How did you use props in this project?
Do you have any recommendations on how we could improve this project for the next cohort?

Copy link

@jessicacaley jessicacaley left a comment

Choose a reason for hiding this comment

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

Great! Very clean and functional solution -- I like that you didn't use any more lines of code than you needed and you obviously understand components and props. "You have met all learning goals for this project." 🎉 Well done!

<h1 className="App-title">Code Monkey</h1>
</header>
<main className="App-main">
<Timeline events={timelineData.events} />

Choose a reason for hiding this comment

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

I like how neat and simple passing timelineData.events is.


const timelineComponents = props.events.map( (event, i) => {
return (
<li key={i}>

Choose a reason for hiding this comment

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

This definitely works, and perhaps is even a better semantic solution, but since the TimelineEvent is a single thing, you could also just return that and not use a ul at all.

return (
<section>
<ul>
{ timelineComponents }

Choose a reason for hiding this comment

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

(See above comment -- again, not a fix, just an alternate idea)

});

return (
<section>

Choose a reason for hiding this comment

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

There was a CSS class provided called "timeline" that sets the width to 30%, margin to auto, and text-align left that you could throw in here.

{props.status}
</p>
<h5>
<Timestamp time={props.timestamp}/>

Choose a reason for hiding this comment

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

Nice use of the provided Timestamp component.

const Timeline = (props) => {

const timelineComponents = props.events.map( (event, i) => {
return (

Choose a reason for hiding this comment

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

There are some provided CSS classes in TimelineEvent.css (timeline-event, timeline-event:hover, event-person, event-status, event-time) that would auto-style things for you :)

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