From 395d3c1748fe4f6c34ea5330befd4a435b9a4136 Mon Sep 17 00:00:00 2001 From: kate myer Date: Tue, 14 Apr 2020 23:34:01 -0700 Subject: [PATCH 1/4] moved events up to this file --- src/App.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 76d86d2..e8562f9 100644 --- a/src/App.js +++ b/src/App.js @@ -3,6 +3,11 @@ import logo from './logo.svg'; import './App.css'; import timelineData from './data/timeline.json'; import Timeline from './components/Timeline'; +import * as timeline from './data/timeline.json'; + +//array of events +const events = timeline.events + function App() { console.log(timelineData); @@ -11,9 +16,10 @@ function App() { return (
-

Application title

+

ADA Lovelace's Social Media Feed

+
); From fe3d594f15f844d0b3cda8d6e7c99c1000bd8d25 Mon Sep 17 00:00:00 2001 From: kate myer Date: Tue, 14 Apr 2020 23:34:39 -0700 Subject: [PATCH 2/4] added props for TimeLine --- src/components/Timeline.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/components/Timeline.js b/src/components/Timeline.js index 463eb3e..087172f 100644 --- a/src/components/Timeline.js +++ b/src/components/Timeline.js @@ -2,9 +2,21 @@ import React from 'react'; import './Timeline.css'; import TimelineEvent from './TimelineEvent'; -const Timeline = () => { +const Timeline = (props) => { - return; -} + const eventComponents = props.events.map((event, i) => { + return ( +
  • + +
  • + ); + }); + + return ( + + ); +}; export default Timeline; \ No newline at end of file From d23e38072f3f0ff55b3bfe0f4c50a5042a581a83 Mon Sep 17 00:00:00 2001 From: kate myer Date: Tue, 14 Apr 2020 23:35:01 -0700 Subject: [PATCH 3/4] added TimeLineEvents props --- src/components/TimelineEvent.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/TimelineEvent.js b/src/components/TimelineEvent.js index cc476c2..af5c0d8 100644 --- a/src/components/TimelineEvent.js +++ b/src/components/TimelineEvent.js @@ -2,9 +2,16 @@ import React from 'react'; import './TimelineEvent.css'; import Timestamp from './Timestamp'; -const TimelineEvent = () => { - - return; +const TimelineEvent = (props) => { + + return ( +
    +
    {props.person}
    +
    {props.status}
    + + +
    + ); } export default TimelineEvent; \ No newline at end of file From 4c88a3f4db110f67d9aaf643f523a45206b4dece Mon Sep 17 00:00:00 2001 From: kate myer Date: Tue, 14 Apr 2020 23:46:01 -0700 Subject: [PATCH 4/4] completed pr --- .github/pull_request_template.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9bd8981..5f95c85 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,6 @@ Congratulations! You're submitting your assignment. Please reflect on the assign Prompt | Response --- | --- -What is a Component in React? | -What are props in React? | -How did you use props in this project? | +What is a Component in React? | Reusable and independent bits of code. Similar to Javascript functions but returns HTML via a render function. | +What are props in React? | Properties used for passing data from one component to another. | +How did you use props in this project? | When moving the array of events (from timeline.json) up to the App.js level, giving it a const name of events, then passing this as a props into the const TimeLine as a parameter. |