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
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: #38A1F3;
padding-bottom: 0.5rem;
color: white;
position: fixed;
Expand Down
11 changes: 9 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ import './App.css';
import timelineData from './data/timeline.json';

import Timeline from './components/Timeline';
// import TimelineEvent from './components/TimelineEvent'; //temp


class App extends Component {

render() {

Choose a reason for hiding this comment

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

Nice use of a variable to make the code in your return clean.

console.log(timelineData);
const eventObjects = timelineData.events.map((event, i) => {

Choose a reason for hiding this comment

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

Looks like you are not using 'i' in this block.

Choose a reason for hiding this comment

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

If you take a look at the JSON, you will see that there is an Events key which is the array of statuses. Both seem to work. :)

return event;
});
console.log(eventObjects);

// Customize the code below
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
<h1 className="App-title">Soash Meeds</h1>
</header>
<main className="App-main">
<Timeline events={eventObjects} />
</main>
</div>
);
Expand Down
19 changes: 16 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import React from 'react';
import './Timeline.css';
import TimelineEvent from './TimelineEvent';
// testing
const Timeline = (props) => {

Choose a reason for hiding this comment

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

Very clean. Looks like you are not using 'i' in this block. You may want to consider using it as a key.

const eventComponents = props.events.map((event, i) => {
return (
<TimelineEvent
person={event.person}
status={event.status}
timestamp={event.timeStamp} />
);
});

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

Choose a reason for hiding this comment

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

Super clean return!

<section class="timeline">
{eventComponents}
</section>
);
}

export default Timeline;

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

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

Choose a reason for hiding this comment

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

Beautiful. Good use of classes. Would this be a place to use className instead of class?

return (
<section class="timeline-event">
<h4 class="event-person">{props.person}</h4>
<p class="event-status">{props.status}</p>
<p class="event-time"><Timestamp time={props.timestamp} /></p>

Choose a reason for hiding this comment

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

It appears that this is not actually working. The date stamps would be something like a year ago (I ran into this problem too). Consider taking a look at the JSON file. The key for timeStamp has a capital 's'. I would play around with this to see if you can see the timestamp based off of the dates in the JSON file. :)

</section>
);
}

export default TimelineEvent;