-
Notifications
You must be signed in to change notification settings - Fork 44
Ports - Myriam #18
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
base: master
Are you sure you want to change the base?
Ports - Myriam #18
Changes from all commits
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 |
|---|---|---|
|
|
@@ -4,17 +4,22 @@ import timelineData from './data/timeline.json'; | |
|
|
||
| import Timeline from './components/Timeline'; | ||
|
|
||
|
|
||
| class App extends Component { | ||
|
|
||
| render() { | ||
| console.log(timelineData); | ||
|
|
||
| // Customize the code below | ||
| const timeLineDataArray = timelineData.events | ||
|
|
||
|
|
||
| return ( | ||
| <div className="App"> | ||
| <header className="App-header"> | ||
| <h1 className="App-title">Application title</h1> | ||
| </header> | ||
| <main className="App-main"> | ||
|
|
||
| <Timeline events={timeLineDataArray}/> | ||
| </main> | ||
|
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. I like this variable name |
||
| </div> | ||
| ); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,18 @@ import React from 'react'; | |
| import './Timeline.css'; | ||
| import TimelineEvent from './TimelineEvent'; | ||
|
|
||
| const Timeline = () => { | ||
| // Fill in your code here | ||
| return; | ||
|
|
||
| const Timeline = (props) => { | ||
|
|
||
| const timeLineEventsData = props.events.map((user, index) => { | ||
| return (<TimelineEvent key= {index} name={user.person} status={user.status} timeStamp={user.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. Does this |
||
|
|
||
| return ( | ||
| <section className="timeline"> | ||
| {timeLineEventsData} | ||
| </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.
|
||
| ) | ||
| } | ||
|
|
||
| export default Timeline; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| .event-status { | ||
| grid-area: 2 / 1 / span 1 / -1; | ||
| word-break: break-all; | ||
| } | ||
|
|
||
| .event-time { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,15 @@ 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.name}</h3> | ||
| <p className="event-status">{props.status}</p> | ||
| <Timestamp time={props.timeStamp}/> | ||
| </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. This looks good! nice JSX! |
||
| } | ||
|
|
||
| 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.
this is interesting! Is this creating a
<Timeline events={dataArray} />?