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 - Steph #9

Open
wants to merge 1 commit 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
82 changes: 22 additions & 60 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.App-header {
background-color: #222;
background-color: rgb(58, 196, 211);
padding-bottom: 0.5rem;
color: white;
position: fixed;
Expand Down
10 changes: 5 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ 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">Your Ada Feed</h1>
</header>
<main className="App-main">
<Timeline events= { timelineData.events } />
</main>
</div>
);
}
}
};
};

export default App;
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: 60%;
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 = () => {

const postData = (props) =>
props.events.map( (post, i) => {
return (
<TimelineEvent person={ post.person } status={ post.status } timeStamp={ post.timeStamp } />
)
})

const Timeline = (props) => {
// Fill in your code here
return;
}
return (
<section className="timeline">
{ postData(props) }
</section>
)
};

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

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

Choose a reason for hiding this comment

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

I like (I think?) that you pulled things out into consts to use later on in your code.

return <Timestamp time={ props } />
};

const TimelineEvent = (props) => {
return(
<section className="timeline-event">
Copy link

Choose a reason for hiding this comment

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

I like that you added classNames!

<h3 className="event-person">{ props.person }</h3>
<p className="event-status">{ props.status }</p>
<p className="event-time">{ postTimestamp(props.timeStamp) }</p>
</section>
)
};

export default TimelineEvent;