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
12 changes: 12 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
width: 100%;
}


.App-title {
text-align: center;
font-size: 1.5em;
Expand All @@ -15,3 +16,14 @@
padding-top: 7rem;
background-color: #E6ECF0;
}

ul{
list-style: none;
width: 50.5%;
padding-left: 18em;
}

li{
padding: 10;
background: white;
}
10 changes: 8 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ 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() {
console.log(timelineData);

// Customize the code below
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
<h1 className="App-title">{timelineData.person}'s Social Media Feed</h1>
</header>
<main className="App-main">
<ul>

<Timeline eventProps={timelineData.events}/>

Choose a reason for hiding this comment

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

I love how you pass through the data here so you can manipulate it in more nested components.

</ul>
</main>
</div>
);
Expand Down
22 changes: 19 additions & 3 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 = () => {
// Fill in your code here
return;


const Timeline = (props) => {
const mappedTimeline = props.eventProps.map((event, index) => {
return (
<li key={index}>

<TimelineEvent person={event.person}
status={event.status}
timeStamp={event.timeStamp}
/>
</li>
);
});
return (
<section>
{mappedTimeline}

Choose a reason for hiding this comment

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

I like how your variable names are clear and easy to follow the logic with!

</section>
);
}

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

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

const TimelineEvent = (props) => {
let time = <Timestamp time= {props.timeStamp} />

return(

<section>
<li>
<p className="event-style">{props.person}</p>
<p className="event-style">{props.status}</p>
<p className="event-style">{time}</p>

</li>
</section>
);
}

export default TimelineEvent;