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 - Elle #15

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
14,879 changes: 5,531 additions & 9,348 deletions package-lock.json

Large diffs are not rendered by default.

31 changes: 20 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"moment": "^2.22.1",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-scripts": "^2.1.5"
"moment": "^2.24.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
6 changes: 3 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import timelineData from './data/timeline.json';
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">Welcome, {timelineData.person}</h1>
</header>
<main className="App-main">
<Timeline items={timelineData.events} />
</main>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Timeline.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.timeline {
width: 30%;
width: 50%;
margin: auto;
text-align: left;
}
18 changes: 15 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ import React from 'react';
import './Timeline.css';
import TimelineEvent from './TimelineEvent';

const Timeline = () => {
// Fill in your code here
return;
const Timeline = (props) => {
// props is an array of "events" which are JS objects from timeline.json
const timelineComponents = props.items.map((event, i) => {
// why do we need .events again ^ here?
return (
<TimelineEvent
key = {i}
person={event.person}
status={event.status}
time={event.timeStamp} />
);
});
return(
<section className="timeline">{timelineComponents}</section>
);
}

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

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

return(
<article className="timeline-event">
<p className="event-person">{props.person}</p>
<p className="event-status">{props.status}</p>
<p className="event-time"><Timestamp time={props.time} /></p>
</article>
);
}

export default TimelineEvent;
2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
margin: 0;
padding: 0;
font-family: 'Muli', sans-serif;
font-family: Arial, Helvetica, sans-serif
}