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

Maja Octos #33

Open
wants to merge 3 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
4,612 changes: 2,306 additions & 2,306 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
.App-main {
padding-top: 7rem;
background-color: #E6ECF0;
}
}
10 changes: 7 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import Timeline from './components/Timeline';

class App extends Component {
render() {
console.log(timelineData);
console.log(timelineData.events);

const allPosts = timelineData.events;

// Customize the code below
return (
<div className="App">
<header className="App-header">
<h1 className="App-title">Application title</h1>
<h1 className="App-title">Ada&apos;s Feed</h1>
</header>
<main className="App-main">

<Timeline events= { allPosts }/>

</main>
</div>
);
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions src/components/Post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { Component } from 'react';
import './Post.css';
import Timestamp from './Timestamp';

class TimelineEvent extends React.Component {
render() {
const person = this.props.person;
const status = this.props.status;
const timeStamp = this.props.timeStamp;

return(
<article className="timeline-event">
<span className="event-person"><strong>{person}</strong></span>
<span className="event-time"><Timestamp time= { timeStamp }/></span>
<p className="event-status">{status}</p>
</article>
)
}
}

export default TimelineEvent;
4 changes: 2 additions & 2 deletions 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;
}
}
16 changes: 13 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import React, { Component } from 'react';
import './Timeline.css';
import TimelineEvent from './TimelineEvent';
import Post from './Post';

class Timeline extends React.Component {
render() {
// Fill in your code here
return;
const events = this.props.events;

const posts = events.map((event)=>{
return <Post person={event.person} status={event.status} time={event.timeStamp} />;
});

return(
<section className="timeline">
{ posts }
</section>

)
}
}

Expand Down
12 changes: 0 additions & 12 deletions src/components/TimelineEvent.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ body {
margin: 0;
padding: 0;
font-family: 'Muli', sans-serif;
}
}