Skip to content

Commit 0933d20

Browse files
committed
part 7f
1 parent 8395c62 commit 0933d20

File tree

2 files changed

+83
-81
lines changed

2 files changed

+83
-81
lines changed

src/content/7/en/part7f.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ lang: en
77

88
<div class="content">
99

10-
In addition to the eight exercises in the [React router](/en/part7/react_router) and [custom hooks](/en/part7/custom_hooks) sections of this seventh part of the course material, 13 exercises continue our work on the Bloglist application that we worked on in parts four and five of the course material. Some of the following exercises are "features" that are independent of one another, meaning that there is no need to finish the exercises in any particular order. You are free to skip over a part of the exercises if you wish to do so. Quite many of the exercises are applying the advanced state management technique (Redux, React Query and context) covered in [part 6](/en/part6).
10+
In addition to the eight exercises in the [React router](/en/part7/react_router) and [custom hooks](/en/part7/custom_hooks) sections of this seventh part of the course material, 13 exercises continue our work on the BlogList application that we worked on in parts four and five of the course material. Some of the following exercises are "features" that are independent of one another, meaning that there is no need to finish them in any particular order. You are free to skip over a part of the exercises if you wish to do so. Quite many of them are about applying the advanced state management technique (Redux, React Query and context) covered in [part 6](/en/part6).
1111

12-
If you do not want to use your Bloglist application, you are free to use the code from the model solution as a starting point for these exercises.
12+
If you do not want to use your BlogList application, you are free to use the code from the model solution as a starting point for these exercises.
1313

1414
Many of the exercises in this part of the course material will require the refactoring of existing code. This is a common reality of extending existing applications, meaning that refactoring is an important and necessary skill even if it may feel difficult and unpleasant at times.
1515

@@ -21,57 +21,57 @@ One good piece of advice for both refactoring and writing new code is to take <i
2121

2222
### Exercises 7.9.-7.21.
2323

24-
#### 7.9: automatic code formatting
24+
#### 7.9: Automatic Code Formatting
2525

26-
In the previous parts, we used ESLint to ensure that code follows the defined conventions. [Prettier](https://prettier.io/) is yet another approach for the same. According to the documentation, Prettier is <i>an opinionated code formatter</i>, that is, Prettier not only controls the code style but also formats the code according to the definition.
26+
In the previous parts, we used ESLint to ensure that the code follows the defined conventions. [Prettier](https://prettier.io/) is yet another approach for the same. According to the documentation, Prettier is <i>an opinionated code formatter</i>, that is, Prettier not only controls the code style but also formats the code according to the definition.
2727

28-
Prettier is easy to integrate into the code editor so that when the code is saved, it is automatically formatted correctly.
28+
Prettier is easy to integrate into the code editor so that when it is saved, it is automatically formatted.
2929

3030
Take Prettier to use in your app and configure it to work with your editor.
3131

32-
### State management: Redux
32+
### State Management: Redux
3333

3434
<i>There are two alternative versions to choose for exercises 7.10-7.13: you can do the state management of the application either using Redux or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
3535

36-
#### 7.10: Redux, step1
36+
#### 7.10: Redux, Step 1
3737

3838
Refactor the application to use Redux to manage the notification data.
3939

40-
#### 7.11: Redux, step2
40+
#### 7.11: Redux, Step 2
4141

4242
<i>Note</i> that this and the next two exercises are quite laborious but incredibly educational.
4343

4444
Store the information about blog posts in the Redux store. In this exercise, it is enough that you can see the blogs in the backend and create a new blog.
4545

4646
You are free to manage the state for logging in and creating new blog posts by using the internal state of React components.
4747

48-
#### 7.12: Redux, step3
48+
#### 7.12: Redux, Step 3
4949

5050
Expand your solution so that it is again possible to like and delete a blog.
5151

52-
#### 7.13: Redux, step4
52+
#### 7.13: Redux, Step 4
5353

5454
Store the information about the signed-in user in the Redux store.
5555

56-
### State management: React Query and context
56+
### State Management: React Query and Context
5757

58-
<i>There are two alternative versions to choose for exercises 7.10-7.13: you can do the state management of the application either using Redux or React Query and Context</i>.
58+
<i>There are two alternative versions to choose for exercises 7.10-7.13: you can do the state management of the application either using Redux or React Query and Context</i>. If you want to maximize your learning, you should do both versions!
5959

60-
#### 7.10: React Query and context step1
60+
#### 7.10: React Query and Context step 1
6161

6262
Refactor the app to use the useReducer-hook and context to manage the notification data.
6363

64-
#### 7.11: React Query and context step2
64+
#### 7.11: React Query and Context step 2
6565

66-
Use React Query to manage the state for blogs. For this exercise, it is sufficient that the application displays existing blogs and that the creation of a new blog is successful.
66+
Use React Query to manage the state for blog posts. For this exercise, it is sufficient that the application displays existing blogs and that the creation of a new blog is successful.
6767

6868
You are free to manage the state for logging in and creating new blog posts by using the internal state of React components.
6969

70-
#### 7.12: React Query and context step3
70+
#### 7.12: React Query and Context step 3
7171

7272
Expand your solution so that it is again possible to like and delete a blog.
7373

74-
#### 7.13: React Query and context step4
74+
#### 7.13: React Query and Context step 4
7575

7676
Use the useReducer-hook and context to manage the data for the logged in user.
7777

@@ -85,23 +85,23 @@ Implement a view to the application that displays all of the basic information r
8585

8686
![browser blogs with users table showing blogs created](../../images/7/41.png)
8787

88-
#### 7.15: Individual user view
88+
#### 7.15: Individual User View
8989

9090
Implement a view for individual users that displays all of the blog posts added by that user:
9191

9292
![browser blogs showing users added blogs](../../images/7/44.png)
9393

94-
You can access the view by clicking the name of the user in the view that lists all users:
94+
You can access this view by clicking the name of the user in the view that lists all users:
9595

9696
![browser blogs showing clickable users](../../images/7/43.png)
9797

9898
<i>**NB:**</i> you will almost certainly stumble across the following error message during this exercise:
9999

100100
![browser TypeError cannot read property name of undefined](../../images/7/42ea.png)
101101

102-
The error message will occur if you refresh the page for an individual user.
102+
The error message will occur if you refresh the individual user page.
103103

104-
The cause of the issue is that, when we navigate directly to the page of an individual user, the React application has not yet received the data from the backend. One solution for fixing the problem is to use conditional rendering:
104+
The cause of the issue is that, when we navigate directly to the page of an individual user, the React application has not yet received the data from the backend. One solution for this problem is to use conditional rendering:
105105

106106
```js
107107
const User = () => {
@@ -120,13 +120,13 @@ const User = () => {
120120
}
121121
```
122122

123-
#### 7.16: Blog view
123+
#### 7.16: Blog View
124124

125125
Implement a separate view for blog posts. You can model the layout of your view after the following example:
126126

127127
![browser blogs showing single blog via URL /blogs/number](../../images/7/45.png)
128128

129-
Users should be able to access the view by clicking the name of the blog post in the view that lists all of the blog posts.
129+
Users should be able to access this view by clicking the name of the blog post in the view that lists all of the blog posts.
130130

131131
![browser showing blogs are clickable](../../images/7/46.png)
132132

@@ -138,9 +138,9 @@ Implement a navigation menu for the application:
138138

139139
![browser blogs navigation navigation menu](../../images/7/47.png)
140140

141-
#### 7.18: comments, step1
141+
#### 7.18: Comments, step 1
142142

143-
Implement the functionality for commenting on blog posts:
143+
Implement the functionality for commenting the blog posts:
144144

145145
![browser blogs showing list of comments for a blog](../../images/7/48.png)
146146

@@ -150,17 +150,17 @@ In this exercise, it is enough for the frontend to only display the comments tha
150150

151151
An appropriate mechanism for adding comments to a blog post would be an HTTP POST request to the <i>api/blogs/:id/comments</i> endpoint.
152152

153-
#### 7.19: comments, step2
153+
#### 7.19: Comments, step 2
154154

155155
Extend your application so that users can add comments to blog posts from the frontend:
156156

157157
![browser showing comments added via frontend](../../images/7/49.png)
158158

159-
#### 7.20: Styles, step1
159+
#### 7.20: Styles, step 1
160160

161161
Improve the appearance of your application by applying one of the methods shown in the course material.
162162

163-
#### 7.21: Styles, step2
163+
#### 7.21: Styles, step 2
164164

165165
You can mark this exercise as finished if you use an hour or more for styling your application.
166166

0 commit comments

Comments
 (0)