Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import Timeline from './components/Timeline';

class App extends Component {
render() {
console.log(timelineData);

// Customize the code below

return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
</header>
<main className="App-main">
<Timeline
events={timelineData.events}/>
</main>
</div>
);
Expand Down
21 changes: 18 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,24 @@ import React from 'react';
import './Timeline.css';
import TimelineEvent from './TimelineEvent';

const Timeline = () => {
// Fill in your code here
return;
const Timeline = (props) => {
const timelineObjects = props.events.map((timeline, i) => {
return (
<TimelineEvent
key={i}
person={timeline.person}
status={timeline.status}
tiemstamp={timeline.timestamp}
/>
)
});
return (
<section>
<ul>
{timelineObjects}
</ul>
</section>
)
}

export default Timeline;
11 changes: 8 additions & 3 deletions src/components/TimelineEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import React from 'react';
import './TimelineEvent.css';
import Timestamp from './Timestamp';

const TimelineEvent = () => {
// Fill in your code here
return;
const TimelineEvent = (props) => {
return (
<section>
<h3>{props.person}</h3>

Choose a reason for hiding this comment

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

Nice use of headers here for styling!

Choose a reason for hiding this comment

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

Question for you. Does your page show timestamps of a year ago or a few seconds ago? If it's a few seconds, try changing your timestamp to timeStamp (with a capital S).

Copy link
Author

Choose a reason for hiding this comment

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

Awesome thanks!

<h4>{props.status}</h4>
<p><Timestamp time={props.timestamp}/></p>
</section>
);
}

export default TimelineEvent;