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
8 changes: 5 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@ import './App.css';
import timelineData from './data/timeline.json';

import Timeline from './components/Timeline';
import TimelineEvent from './components/TimelineEvent';

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

// console.log(timelineData.events);
// Customize the code below
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
<h1 className="App-title">I Do Not Like This Sam I Am</h1>

Choose a reason for hiding this comment

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

😂 React is awesome though!

</header>
<main className="App-main">
<Timeline
events={timelineData.events}/>
</main>
</div>
);
Expand Down
23 changes: 20 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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((timeline, i) => {

Choose a reason for hiding this comment

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

Nice nesting of these functions 👍

return (
<TimelineEvent
key={i}
person={timeline.person}
status={timeline.status}
timestamp={timeline.timeStamp}
/>
)
});
return (
<section>
<ul>
{timelineComponents}
</ul>
</section>
)
}

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

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

Choose a reason for hiding this comment

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

don't forgot to indent for this section 😁

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

export default TimelineEvent;