Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports - Amy M #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import React, { Component } from 'react';
import './App.css';
import timelineData from './data/timeline.json';
import TimelineEvent from './components/TimelineEvent'

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>
<h1 className="App-title">Ada Lovelace's social media feed</h1>
Copy link

Choose a reason for hiding this comment

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

Big Ups to Ada!!

</header>
<main className="App-main">
<Timeline events={ timelineData.events } />
</main>
</div>
);
}
}

export default App;
export default App;
4 changes: 4 additions & 0 deletions src/components/Timeline.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
margin: auto;
text-align: left;
}

ul {
list-style: none;
}
27 changes: 23 additions & 4 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,28 @@ 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

const TimelineEventComponents = events.map( (event, i) => {
return (
<li key={i}>
<TimelineEvent
person={ event.person }
status={ event.status }
timeStamp={ event.timeStamp }/>
</li>
);
});

return (
<section>
<ul>
{ TimelineEventComponents }
</ul>
</section>
);
}

export default Timeline;
export default Timeline;
1 change: 1 addition & 0 deletions src/components/TimelineEvent.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

.event-status {
grid-area: 2 / 1 / span 1 / -1;
word-break: break-all;
}

.event-time {
Expand Down
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 className="timeline timeline-event">
<span className="event-person">{ props.person }</span>
<span className="event-time"><Timestamp time={ props.timeStamp } /></span>
<p className="event-status">
{ props.status }
</p>
</section>
);
Copy link

Choose a reason for hiding this comment

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

I love how you broke everything into a className!

}

export default TimelineEvent;