Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 46094ab

Browse files
committed
Day 2: title formatting coherence, minor edits
1 parent 8c99c83 commit 46094ab

File tree

11 files changed

+40
-42
lines changed

11 files changed

+40
-42
lines changed

step2-01/demo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.1: Introduction to TypeScript (Demo)
1+
# Step 2.1 - Introduction to TypeScript (Demo)
22

33
[Lessons](../../) | [Exercise](../exercise/)
44

@@ -28,11 +28,11 @@ The most important ones to know about are:
2828

2929
> For more information about the _many_ modularity patterns and standards developed over time, see [this article](https://medium.freecodecamp.org/javascript-modules-a-beginner-s-guide-783f7d7a5fcc). You may still encounter some of the older patterns in legacy code.
3030
31-
## TypeScript Types
31+
## TypeScript types
3232

3333
Refer to [`demo/src/types`](./src/types/index.ts) for examples of some of the types available in TS that benefit a React developer.
3434

35-
## Spread Operator
35+
## Spread operator
3636

3737
The spread operator `...` provides a quick way to clone and concatenate objects and arrays. This syntax is seen a lot inside React props and Redux reducers.
3838

@@ -139,7 +139,7 @@ aPromise
139139

140140
> For more information, see [this overview of promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_promises) or [this deep dive](https://developers.google.com/web/fundamentals/primers/promises).
141141
142-
## Async / Await
142+
## Async / await
143143

144144
**Async / Await** is a language-level feature for writing asynchronous functions as if they are ordinary, synchronous code. JS support for this is built on top of `Promise`s and is inspired heavily by [C#'s async / await syntax](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/). An async function is written like this:
145145

step2-01/exercise/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.1: Introduction to TypeScript (Exercise)
1+
# Step 2.1 - Introduction to TypeScript (Exercise)
22

33
[Lessons](../../) | [Demo](../demo/)
44

@@ -20,7 +20,7 @@ Exercises will be completed under this step's `exercise/src` folder unless other
2020

2121
5. Inside `index.ts` in the same folder, import both `fib` and `FibConst`, and use the built-in `console.log()` function to log the result of `fib(FibConst)`.
2222

23-
## Types and Interfaces
23+
## Types and interfaces
2424

2525
Inside `exercise/src/index.ts`:
2626

@@ -38,7 +38,7 @@ Inside `exercise/src/stack.ts`, create a generic class for a `Stack<T>` complete
3838
3939
In `exercise/src/index.ts`, create a `Stack<number>` and use `console.log()` to demonstrate its functionality.
4040

41-
## Spread and Destructuring
41+
## Spread and destructuring
4242

4343
1. Note the following code in index.ts:
4444

@@ -61,7 +61,7 @@ const obj2 = {
6161

6262
3. Use the destructuring syntax to retrieve the values for `{first, second, catcher}` from `megaObj`.
6363

64-
## Async / Await
64+
## Async / await
6565

6666
Note the following code in index.ts:
6767

step2-02/demo/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.2: UI Fabric Component Library (Demo)
1+
# Step 2.2 - UI Fabric component library (Demo)
22

33
[Lessons](../../) | [Exercise](../exercise/)
44

@@ -11,7 +11,7 @@ We'll talk about:
1111
- [How to use it](#how-to-use-it)
1212
- [Laying out apps with Stack](#layout-with-stack)
1313

14-
## What Makes It Good
14+
## What makes it good
1515

1616
- Fabric has been developed BOTH by developers and design engineers working together as a team
1717
- Most notable Microsoft web products use it
@@ -23,17 +23,17 @@ We'll talk about:
2323
- Engineering is done in the open on GitHub
2424
- Engineering system is shared and re-usable by other teams
2525

26-
## How to Find It
26+
## How to find it
2727

2828
GitHub repo:
2929
https://github.com/officedev/office-ui-fabric-react
3030

3131
Documentation:
3232
https://developer.microsoft.com/en-us/fabric/#/components
3333

34-
## How to Use It
34+
## How to use it
3535

36-
### Importing a Component
36+
### Importing a component
3737

3838
```jsx
3939
import { DefaultButton } from 'office-ui-fabric-react';
@@ -47,7 +47,7 @@ const MyComponent = () => {
4747
};
4848
```
4949

50-
### Customizing Behavior of Individual Components
50+
### Customizing behavior of individual components
5151

5252
Take a look at the [Button documentation](https://developer.microsoft.com/en-us/fabric#/components/button).
5353

@@ -65,7 +65,7 @@ const MyComponent = () => {
6565
};
6666
```
6767

68-
### Customizing Component Rendering
68+
### Customizing component rendering
6969

7070
Some Fabric components take in a render functions to allow customizing certain parts of the component. An example with TextField:
7171

@@ -84,7 +84,7 @@ const MyComponent = () => {
8484

8585
## Layout with Stack
8686

87-
Before we start, let's look at flexbox--a new CSS layout method which is powerful, but really, really complex to use:
87+
Before we start, let's look at flexbox--a modern CSS layout method which is powerful, but really, really complex to use:
8888

8989
- A guide: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
9090
- A tool: http://the-echoplex.net/flexyboxes/

step2-02/exercise/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.2: UI Fabric Component Library (Exercise)
1+
# Step 2.2 - UI Fabric component library (Exercise)
22

33
[Lessons](../../) | [Demo](../demo/)
44

step2-03/demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.3: Theming and styling with UI Fabric (Demo)
1+
# Step 2.3 - Theming and styling with UI Fabric (Demo)
22

33
[Lessons](../../) | [Exercise](../exercise/)
44

step2-03/exercise/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# Step 2.3: Theming and styling with UI Fabric (Exercise)
1+
# Step 2.3 - Theming and styling with UI Fabric (Exercise)
22

33
[Lessons](../../) | [Demo](../demo/)
44

55
If you don't already have the app running, start it by running `npm start` from the root of the `frontend-bootcamp` folder. Click the "exercise" link under day 2 step 3 to see results.
66

7-
## Fabric theming and styling
8-
9-
### Applying Fabric themes
7+
## Applying Fabric themes
108

119
Try applying some predefined themes from UI Fabric packages inside the TodoApp under `exercise/src/components/TodoApp.tsx`. Do this by replacing:
1210

@@ -20,7 +18,7 @@ with:
2018
import { TeamsCustomizations } from '@uifabric/theme-samples';
2119
```
2220

23-
### Applying customized themes
21+
## Applying customized themes
2422

2523
1. Create your own theme using the [theme generator](https://developer.microsoft.com/en-us/fabric#/styles/themegenerator) and copy the generated code.
2624

@@ -30,7 +28,7 @@ import { TeamsCustomizations } from '@uifabric/theme-samples';
3028

3129
4. Play around with the values and use VS Code's intellisense to discover more properties of the `ITheme` type.
3230

33-
### Customizing one Fabric control instance
31+
## Customizing one Fabric control instance
3432

3533
1. Open `exercise/src/components/TodoFooter.tsx`
3634

@@ -40,9 +38,9 @@ import { TeamsCustomizations } from '@uifabric/theme-samples';
4038

4139
4. Try to customize this with a styles function
4240

43-
## Advanced/non-Fabric component styling
41+
## CSS-in-JS with `mergeStyles`
4442

45-
### CSS-in-JS with `mergeStyles`
43+
As mentioned in the demo, this is an advanced approach which also works outside of Fabric. You wouldn't typically use this approach within a Fabric-based app.
4644

4745
1. Try generating a class name using `mergeStyles` and use it as a `className` prop inside `TodoApp`
4846

step2-04/demo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ We will solve these problems with the [React Context API](https://reactjs.org/do
88

99
1. The problem of complex applications
1010
2. React Context API
11-
3. Consuming context from a Class Component
12-
4. Consuming context from a Functional Component
11+
3. Consuming context from a class component
12+
4. Consuming context from a functional component
1313

1414
## The problem of complex applications
1515

@@ -81,7 +81,7 @@ class TodoApp extends React.Component {
8181
}
8282
```
8383

84-
### Consume context from a Class Component
84+
### Consume context from a class component
8585

8686
Inside a class-based child component, such as `<TodoHeader>`, the context created in the parent can be accessed via `this.context`. Note that for this to work, you must also set the component class's `contextType` property to the context type created above.
8787

@@ -97,7 +97,7 @@ class TodoHeader extends React.Component {
9797
TodoHeader.contextType = TodoContext;
9898
```
9999

100-
### Consume context from a Functional Component
100+
### Consume context from a functional component
101101

102102
If you're using the functional component syntax, you can access the context with the `useContext()` hook:
103103

step2-04/exercise/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
If you don't already have the app running, start it by running `npm start` from the root of the `frontend-bootcamp` folder. Click the "exercise" link under day 2 step 4 to see results.
66

7-
## TodoContext.Provider Component
7+
## TodoContext.Provider component
88

99
1. Open `exercise/src/components/TodoApp.tsx`
1010

1111
2. Uncomment the missing functions inside the value prop
1212

13-
## TodoFooter, Context inside Functional Component
13+
## TodoFooter: context inside functional component
1414

1515
1. Open `exercise/src/components/TodoFooter.tsx`
1616

1717
2. Use `useContext` to access the `TodoContext` and replace the two constants with values from the context
1818

19-
## TodoHeader, Context inside Class Component
19+
## TodoHeader: context inside class component
2020

2121
1. Open `exercise/src/components/TodoHeader.tsx`
2222

step2-05/exercise/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# Step 2.5: Redux: Reducers (Exercise)
1+
# Step 2.5 - Redux: The Store (Exercise)
22

33
[Lessons](../../) | [Demo](../demo/)
44

55
If you don't already have the app running, start it by running `npm start` from the root of the `frontend-bootcamp` folder. Click the "exercise" link under day 2 step 5 to see results.
66

77
1. First, take a look at the store interface in `exercise/src/store/index.ts`. Note that the `Store` interface has two keys: `todos` and `filter`. We'll concentrate on `todos`, which is an object where the keys are string IDs and the values are of type `TodoItem`.
88

9-
2. Open `exercise/src/reducers/index.ts` and fill in the missing case statements for the switch on `action.type`.
9+
2. Open `exercise/src/reducers/index.ts` and fill in the missing reducer implementations.
1010

11-
3. Open `exercise/src/index.tsx` and write separate dispatch calls.
11+
3. Open `exercise/src/index.tsx` and write some `dispatch` calls.
1212

13-
4. Take a look what is written in the console (F12 on PC, cmd-option-I on Mac).
13+
4. Take a look what is written in the console (F12 on PC, `cmd-option-I` on Mac).
1414

15-
5. Install the Redux DevTools [Chrome](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/) extensions
15+
5. Install the Redux DevTools [Chrome](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/reduxdevtools/) extension
1616

1717
6. Observe the state changes and try doing "time travel"

step2-06/demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Step 2.6: Redux: React Binding (Demo)
1+
# Step 2.6 - Redux: React binding (Demo)
22

33
[Lessons](../../) | [Exercise](../exercise/)
44

0 commit comments

Comments
 (0)