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: 3 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import Timeline from './components/Timeline';
class App extends Component {
render() {
console.log(timelineData);

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

const Timeline = () => {
const Timeline = (props) => {
// Fill in your code here
return;

const allTimelineEvents = props.events.map((timelineEvent,i)=>{
return (
<ul key={i}>
<TimelineEvent
person={timelineEvent.person}
status={timelineEvent.status}
timeStamp={timelineEvent.timeStamp}
/>
</ul>
);
});
return(
<section className="timeline">
{allTimelineEvents}
</section>
);
}

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

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

return (
<ul className="timeline-event">

<div className="event-person">
{props.person}
</div>
<div className="event-status">
{props.status}
</div>

<div className="event-time">
<Timestamp time={props.timeStamp}/>
</div>
</ul>
);
}

export default TimelineEvent;