Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit b7c7bd6

Browse files
authored
Merge pull request #37 from githubtraining/partyshah-edits
Undo githubteacher
2 parents 5e8d782 + 40a5fa9 commit b7c7bd6

21 files changed

+194
-144
lines changed

config.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ before:
1414
- type: updateBranchProtection
1515

1616
steps:
17-
- title: Open a Pull Request
17+
- title: Open a pull request
1818
description: Welcome to React! Let's get started with our project.
1919
event: pull_request.opened
2020
link: '{{ repoUrl }}/issues/1'
@@ -39,7 +39,7 @@ steps:
3939
body: header-component-activity.md
4040
file: src/App.jsx
4141
position: 85
42-
- title: Add a Header Component
42+
- title: Add a header component
4343
description: Give your app a title by adding a header component
4444
event: push
4545
link: '{{ repoUrl }}/issues/2'
@@ -59,7 +59,7 @@ steps:
5959
file: src/App.jsx
6060
position: 3
6161
pullRequest: '%actions.metaPR2.data.number%'
62-
- title: Import a Child Component
62+
- title: Import a child component
6363
description: Import a child component into its parent
6464
event: push
6565
link: '{{ repoUrl }}/issues/2'
@@ -76,7 +76,7 @@ steps:
7676
file: src/App.jsx
7777
position: 46
7878
pullRequest: '%actions.metaPR2.data.number%'
79-
- title: Uncomment Assignments Functionality
79+
- title: Uncomment assignments section
8080
description: Add the ability to create assignments
8181
event: push
8282
link: '{{ repoUrl }}/issues/2'
@@ -104,7 +104,7 @@ steps:
104104
file: src/List.jsx
105105
position: 5
106106
pullRequest: '%actions.metaPR2.data.number%'
107-
- title: Replace the Title Prop
107+
- title: Replace the title prop
108108
description: Pass a title prop to the List child component
109109
event: push
110110
link: '{{ repoUrl }}/issues/2'
@@ -124,7 +124,7 @@ steps:
124124
file: src/App.jsx
125125
position: 12
126126
pullRequest: '%actions.metaPR2.data.number%'
127-
- title: Add a State Variable
127+
- title: Add a state variable
128128
description: Add a students state variable to keep track of students
129129
event: push
130130
link: '{{ repoUrl }}/issues/2'
@@ -146,8 +146,8 @@ steps:
146146
file: src/App.jsx
147147
position: 38
148148
pullRequest: '%actions.metaPR2.data.number%'
149-
- title: Create a Function
150-
description: Create a function to add students to our state
149+
- title: Create a method
150+
description: Create a method to add students to our state
151151
event: push
152152
link: '{{ repoUrl }}/issues/2'
153153
actions:
@@ -174,8 +174,8 @@ steps:
174174
file: src/App.jsx
175175
position: 20
176176
pullRequest: '%actions.metaPR2.data.number%'
177-
- title: Bind a Function
178-
description: Bind the addStudents function to our class
177+
- title: Bind a method
178+
description: Bind the addStudents method to our class
179179
event: push
180180
link: '{{ repoUrl }}/issues/2'
181181
actions:
@@ -205,15 +205,12 @@ steps:
205205
file: src/App.jsx
206206
position: 52
207207
pullRequest: '%actions.metaPR2.data.number%'
208-
- type: respond
209-
with: callback-example.md
210-
issue: Changes
211208
- type: createPullRequestComment
212209
body: change-props-students-activity.md
213210
file: src/App.jsx
214211
position: 68
215212
pullRequest: '%actions.metaPR2.data.number%'
216-
- title: Pass Functions as Props
213+
- title: Pass functions as props
217214
description: Learn how to pass data back to parent components
218215
event: push
219216
link: '{{ repoUrl }}/issues/2'
@@ -230,19 +227,30 @@ steps:
230227
file: src/App.jsx
231228
position: 78
232229
pullRequest: '%actions.metaPR2.data.number%'
233-
- title: Get Your Pull Request Approved
230+
- title: Get your pull request approved
234231
event: push
235232
description: Let's confirm you made the right changes
236233
actions:
237234
- type: gate
238235
left: '%payload.ref%'
239236
operator: ===
240237
right: refs/heads/changes
238+
- type: getFileContents
239+
action_id: fileContents
240+
filename: 'src/App.jsx'
241+
- type: gate
242+
left: '/^\s*if\s*\(\s*this.state.buttonClicked\s*===\s*"grades"\)\s*{\s*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*}\s*\n/gm'
243+
operator: test
244+
right: '%actions.fileContents%'
245+
else:
246+
- type: respond
247+
with: bad-uncomment.md
248+
issue: Changes
241249
- type: createReview
242250
event: APPROVE
243251
body: approve.md
244252
pullRequest: Changes
245-
- title: Merge your Pull Request
253+
- title: Merge your pull request
246254
event: pull_request.closed
247255
description: Congrats on finishing the course!
248256
actions:

course-details.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ Congratulations on taking some of your first steps into full stack development!
55
So why did you decide to click and join this course? Ideally, you are a learner who:
66

77
- Understands HTML tags
8-
- Understands classes and methods in Javascript
9-
- Understands git and GitHub
8+
- Understands classes and methods in JavaScript
9+
- Understands Git and GitHub
1010

1111
If you understand the topics above, you can start learning modern frontend development with React!
1212

responses/01-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Building Blocks of ~~Life~~ Apps - Components
22

3-
React apps are made up of components. Think of components as different parts of the app. Each button is a component, each text is a component etc. From html, you might recognize some of the built in components like `<div />` and `<li />`, but in React, we can create our own components! How cool is that?
3+
**Components** are the **building blocks of React apps**. Think of components as different parts of the app. Each button is a component, each text is a component etc. From html, you might recognize some of the built in components like `<div />` and `<li />`, but in React, we can create our own components! How cool is that?
44

5-
### Components in `App.jsx`
5+
### Components in `src/App.jsx`
66
![Assignments Solution](https://user-images.githubusercontent.com/25253905/61293228-11f26580-a788-11e9-90ac-9612c2bddf6b.png)
77

88
In our [solution](https://githubtraining.github.io/react-solution/), our assignments page looks like the above. The overall webpage is a component that we call `App` and inside `App` there's are other components like buttons, titles, and even other custom components that we can create (like the Assginments List).
99

10-
Take a look at the following line in `App.jsx`.
10+
Take a look at the following line in `src/App.jsx`.
1111

1212
```javascript
1313
class App extends React.Component

responses/02-props.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
## How to Talk to your Child - Props
22

3-
Alright, so we established that components are awesome, but what about reusable components with different properties?
3+
Now, let's discuss how we can reuse the same component with different properties.
44

55
That might sound a little confusing, but let's take a look. Go to our final [solution](https://githubtraining.github.io/react-solution/) and add some assignments along with students. You might start to notice that both lists look the same but with different values. In fact, both lists are the same component!
66

7-
Hmmm, but how do we pass different values to a component? We do so by passing properties to the component, otherwise known as props.
7+
However, how do we pass different values to a component? We do so by passing **properties to the component**, otherwise known as **props**.
88

99
We will get a little deeper into that in a bit.
1010

responses/03-state.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Content
2-
31
## A Date with Data - State Variables
42

53
So now, we learned how to pass data to components, but let's talk about the data itself.
@@ -8,7 +6,7 @@ There are two types of data: **static data** and **dynamic data**.
86

97
Static data doesn't change, hence the name static. Things like a title on a page or the name of a button would be static data.
108

11-
Dynamic data, on the other hand, is data that does change because we can change it by adding an item to the list. Our list of assignments would be considered dynamic data. But how do we deal with dyanmic data in React? We can't just dump it in a component, because how will we tell the data to change?
9+
Dynamic data, on the other hand, is data that does change because we can change it by adding an item to the list. Our list of assignments would be considered dynamic data. But how do we deal with dynamic data in React? We can't just dump it in a component, because how will we tell the data to change?
1210

1311

1412
Scroll below to take a look in the code!

responses/04-callbackfunctions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
# Content
2-
31
## Throwing it Back - Callback Functions
42

53
The last thing you need to know before you can call yourself a React Developer is callback functions. We said that we can pass data to the child with `props`, but what about passing data from the child to the parent?
64

7-
With callback functions, we are able to do just that. Basically, we pass a function as a prop, and then the child component can call the function that was defined in the parent. Yeah, that's confusing. Let's look at an example.
5+
With **callback functions**, we are able to do just that. Basically, we **pass a function as a prop**, and then the child component can call the function that was defined in the parent. Yeah, that's confusing. Let's look at an example.
86

97
Scroll Below!

responses/05-congrats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Congratulations on finishing Introduction to React. You can go ahead and pull fr
55
Although this course certainly doesn't mean you are a React expert, we hope you have the tools to explore further content on your own. Here are some cool resources for further learning:
66

77
- [Create your own React App](https://facebook.github.io/create-react-app/docs/getting-started)
8-
- [Depolying a React App to GitHub Pages](https://codeburst.io/deploy-react-to-github-pages-to-create-an-amazing-website-42d8b09cd4d)
8+
- [Deploying a React App to GitHub Pages](https://codeburst.io/deploy-react-to-github-pages-to-create-an-amazing-website-42d8b09cd4d)
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
### Step 6 - Add a state variable
1+
### Step 6: Add a state variable
22

3-
In React, we store dynamic data in **state variables**. Let's take a look at how we store state variables. In `App.jsx`, take a look at the constructor. You'll see that we declare our state variables using `this.state = {.....}`.
3+
In React, we store dynamic data in **state variables**. Let's take a look at how we store state variables. In `src/App.jsx`, take a look at the constructor. You'll see that we declare our state variables using `this.state = {.....}`.
44

55

66
Currently, in `App`, we have three state variables:
77
- `buttonClicked` - This stores which button was clicked. It is a state variable because the button that is clicked has the ability to change.
88
- `assignments` - This stores the list of assignments. It is a state variable because the list changes every time a new assignment is added.
99
- `grades` - This should store the grade for each student. However, we have no way to store students, so let's fix that!
1010

11-
### :keyboard: Activity: Add a state variable to `App.jsx`
11+
### :keyboard: Activity: Add a state variable to `src/App.jsx`
1212

13-
1. Add a state variable to `App` and name it `students`. Set it equal to an empty array. Make sure to add the comma!
14-
2. Run your code with `npm start` to make sure there are no errors.
15-
3. Commit and push your code to the `changes` branch:
13+
1. On line 11, add a state variable named `students`
14+
2. Set `students` equal to an empty array
15+
3. Add a comma: `students: [],`
16+
4. Save your code
17+
5. To run your code, move inside your repo folder in your terminal and run `npm start`
18+
6. Exit the process in your terminal using `Ctrl + C`
19+
7. Commit and push your code to the `changes` branch:
1620
```
1721
git add src/App.jsx
18-
git commit -m "import list component"
19-
git push origin changes
22+
git commit -m "add a state variable for students"
23+
git push
2024
```
2125
22-
I'll respond after you push.
26+
<hr>
27+
<h3 align="center">Watch below this comment for my response</h3>

responses/approve.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
## Merge the Pull Request
1+
## Step 11: Merge your pull request
22

3-
Changes are approved!
3+
We have approved all of your chages
44

5-
Go ahead and merge the Pull Request!
5+
### :keyboard: Activity: Merge the `changes` branch into `master`
6+
1. Click the `Merge Pull Request` button
7+
8+
<hr>
9+
<h3 align="center">Watch below this comment for my response</h3>
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
### Step 8 - Binding a function
1+
### Step 8: Binding a method
22

33
Also, since we created a method that changes the a state variable, we have to bind it to our class, so that when we call it, we know what method to reference.
44

55
Go ahead and uncomment the line to bind `addStudent` to `App`.
66

77
### :keyboard: Activity: Bind `addStudent` to `App`
88

9-
1. Uncomment the line to bind `addStudent` to `App`.
10-
2. Run your code with `npm start` to make sure there are no errors.
9+
1. On line 19, uncomment the line to bind `addStudent` to `App`
10+
2. Save your code
11+
3. To run your code, move inside your repo folder in your terminal and run `npm start`
12+
4. Exit the process in your terminal using `Ctrl + C`
1113
3. Commit and push your code to the `changes` branch:
1214
```
1315
git add src/App.jsx
14-
git commit -m "import list component"
15-
git push origin changes
16+
git commit -m "bind addStudent to App"
17+
git push
1618
```
1719
18-
I'll respond after you push.
20+
<hr>
21+
<h3 align="center">Watch below this comment for my response</h3>

0 commit comments

Comments
 (0)