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

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

class App extends Component {
render() {
Expand All @@ -12,9 +14,10 @@ class App extends Component {
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
<h1 className="App-title">Ada Lovelace's social media feed</h1>
</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.

Yes!

</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 events = props.events.map((event, i) => {
return (
<TimelineEvent key={i}
person={event.person}
status={event.status}
time={event.timeStamp} />

Choose a reason for hiding this comment

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

I like how you spaced these out, it makes it easy to read

);
});

return (
<section>

{events}

</section>
);
}

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

const TimelineEvent = () => {
const TimelineEvent = (props) => {
// Fill in your code here
return;
// const time = props.time
return(
<section className="timeline-event">
<div className="event-person">
{props.person}
</div>
<div className="event-status">
{props.status}
</div>
<div className="event-timestamp">
<Timestamp time={props.time} />
</div>
</section>

Choose a reason for hiding this comment

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

I like that these are in div elements

);
}

export default TimelineEvent;