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

Ampers Steffany #42

Open
wants to merge 5 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
7 changes: 5 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ import Timeline from './components/Timeline';

class App extends Component {
render() {

const thisTimeline = <Timeline events={timelineData.events} />

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 Timeline</h1>
</header>
<main className="App-main">
{thisTimeline}
</main>
</div>
);
Expand Down
18 changes: 16 additions & 2 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,22 @@ import TimelineEvent from './TimelineEvent';

class Timeline extends React.Component {
render() {
// Fill in your code here
return;

const timelineData = this.props.events.map((post) => {
return (
<TimelineEvent
key={post.person}
person={post.person}
status={post.status}
timestamp={post.timeStamp}
/>
);
});
return (
<section className="timeline">
{timelineData}
</section>
);
}
}

Expand Down
12 changes: 10 additions & 2 deletions src/components/TimelineEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ import Timestamp from './Timestamp';

class TimelineEvent extends React.Component {
render() {
// Fill in your code here
return;
const eventAuthor = this.props.person;
const eventStatus = this.props.status;
const eventTime = <Timestamp time={this.props.timeStamp} />;
return (
<article className="timeline-event">
<p className="event-person">{eventAuthor}</p>
<p className="event-time">TIME: {eventTime}</p>
<p className="event-status">STATUS: {eventStatus}</p>
</article>
);
}
}

Expand Down