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

Time - Vera #42

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
6 changes: 4 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@ import logo from './logo.svg';
import './App.css';
import timelineData from './data/timeline.json';
import Timeline from './components/Timeline';
// import TimelineEvent from './components/TimelineEvent';

function App() {
console.log(timelineData);
// 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}' social media feed</h1>
</header>
<main className="App-main">
<Timeline eventsData={timelineData.events} />
</main>
</div>
);
Expand Down
12 changes: 11 additions & 1 deletion src/components/Timeline.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
.timeline {
width: 30%;
width: 40%;
margin: auto;
text-align: left;

}

.timeline li {
list-style-type: none;

}

.event-status {
word-wrap: break-word;
}
20 changes: 17 additions & 3 deletions src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,23 @@ import React from 'react';
import './Timeline.css';
import TimelineEvent from './TimelineEvent';

const Timeline = () => {

return;
const Timeline = (props) => {
const events = props.eventsData.map((event, i)=> {
return(
<li key={i}>
<TimelineEvent
person={event.person}
status={event.status}
timeStamp={event.timeStamp}
/>
</li>
);
});
return(
<ul className="timeline">
{events}
</ul>
);
}

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

const TimelineEvent = () => {

return;
const TimelineEvent = (props) => {
console.log(props)

return(
<div className="timeline-event">
<h3 className="event-person">{props.person}</h3>
<p className="event-time"><Timestamp time={props.timeStamp} /></p>
<p className="event-status">{props.status}</p>
</div>

);
}

export default TimelineEvent;