-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: master
Are you sure you want to change the base?
Changes from all commits
5add318
ada19c5
ee2133e
c823de3
4c49dcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
width: 30%; | ||
margin: auto; | ||
text-align: left; | ||
list-style-type: none; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,26 @@ import React from 'react'; | |
import './Timeline.css'; | ||
import TimelineEvent from './TimelineEvent'; | ||
|
||
const Timeline = () => { | ||
// Fill in your code here | ||
return; | ||
const Timeline = (props) => { | ||
|
||
const timelineComponents = props.events.map( (event, i) => { | ||
return ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) |
||
<li key={i}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
<TimelineEvent | ||
person={ event.person } | ||
status={ event.status } | ||
timestamp={ event.timeStamp }/> | ||
</li> | ||
); | ||
}); | ||
|
||
return ( | ||
<section> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
<ul className="timeline"> | ||
{ timelineComponents } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (See above comment -- again, not a fix, just an alternate idea) |
||
</ul> | ||
</section> | ||
); | ||
} | ||
|
||
export default Timeline; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,20 @@ import React from 'react'; | |
import './TimelineEvent.css'; | ||
import Timestamp from './Timestamp'; | ||
|
||
const TimelineEvent = () => { | ||
// Fill in your code here | ||
return; | ||
const TimelineEvent = (props) => { | ||
return ( | ||
<section className="timeline-event"> | ||
<h3 className="event-person"> | ||
{props.person} | ||
</h3> | ||
<p className="event-status"> | ||
{props.status} | ||
</p> | ||
<h5 className="event-time"> | ||
<Timestamp time={props.timestamp}/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice use of the provided Timestamp component. |
||
</h5> | ||
</section> | ||
); | ||
} | ||
|
||
export default TimelineEvent; |
There was a problem hiding this comment.
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.