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

Ports - Amy W #3

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

Ports - Amy W #3

wants to merge 5 commits into from

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!

</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