Skip to content

Commit 6a531cb

Browse files
committed
add recommended tutorials
1 parent c78ba14 commit 6a531cb

File tree

3 files changed

+44
-16
lines changed

3 files changed

+44
-16
lines changed

README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
1-
# Vue.js CRUD App with Vue Router & Axios
1+
# React.js CRUD App with React Router & Axios
22

33
For more detail, please visit:
4-
> [React.js CRUD example to consume Web API](https://bezkoder.com/react-crud-web-api/)
4+
> [React (Components) CRUD example to consume Web API](https://bezkoder.com/react-crud-web-api/)
5+
6+
> [React (Hooks) CRUD example to consume Web API](https://bezkoder.com/react-hooks-crud-axios-api/)
7+
8+
Fullstack with Node.js Express:
9+
> [React.js + Node.js Express + MySQL](https://bezkoder.com/react-node-express-mysql/)
10+
11+
> [React.js + Node.js Express + PostgreSQL](https://bezkoder.com/react-node-express-postgresql/)
12+
13+
> [React.js + Node.js Express + MongoDB](https://bezkoder.com/react-node-express-mongodb-mern-stack/)
14+
15+
Fullstack with Spring Boot:
16+
> [React.js + Spring Boot + MySQL](https://bezkoder.com/react-spring-boot-crud/)
17+
18+
> [React.js + Spring Boot + MongoDB](https://bezkoder.com/react-spring-boot-mongodb/)
19+
20+
Fullstack with Django:
21+
22+
> [React.js + Django Rest Framework](https://bezkoder.com/django-react-axios-rest-framework/)
23+
24+
Serverless:
25+
> [React Firebase CRUD App with Realtime Database](https://bezkoder.com/react-firebase-crud/)
26+
27+
> [React Firestore CRUD App example | Firebase Cloud Firestore](https://bezkoder.com/react-firestore-crud/)
28+
529

630
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
731

src/components/tutorial.component.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ export default class Tutorial extends Component {
114114
}
115115

116116
render() {
117+
const { currentTutorial } = this.state;
118+
117119
return (
118120
<div>
119-
{this.state.currentTutorial ? (
121+
{currentTutorial ? (
120122
<div className="edit-form">
121123
<h4>Tutorial</h4>
122124
<form>
@@ -126,7 +128,7 @@ export default class Tutorial extends Component {
126128
type="text"
127129
className="form-control"
128130
id="title"
129-
value={this.state.currentTutorial.title}
131+
value={currentTutorial.title}
130132
onChange={this.onChangeTitle}
131133
/>
132134
</div>
@@ -136,7 +138,7 @@ export default class Tutorial extends Component {
136138
type="text"
137139
className="form-control"
138140
id="description"
139-
value={this.state.currentTutorial.description}
141+
value={currentTutorial.description}
140142
onChange={this.onChangeDescription}
141143
/>
142144
</div>
@@ -145,11 +147,11 @@ export default class Tutorial extends Component {
145147
<label>
146148
<strong>Status:</strong>
147149
</label>
148-
{this.state.currentTutorial.published ? "Published" : "Pending"}
150+
{currentTutorial.published ? "Published" : "Pending"}
149151
</div>
150152
</form>
151153

152-
{this.state.currentTutorial.published ? (
154+
{currentTutorial.published ? (
153155
<button
154156
className="badge badge-primary mr-2"
155157
onClick={() => this.updatePublished(false)}

src/components/tutorials-list.component.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export default class TutorialsList extends Component {
8585
}
8686

8787
render() {
88+
const { searchTitle, tutorials, currentTutorial, currentIndex } = this.state;
89+
8890
return (
8991
<div className="list row">
9092
<div className="col-md-8">
@@ -93,7 +95,7 @@ export default class TutorialsList extends Component {
9395
type="text"
9496
className="form-control"
9597
placeholder="Search by title"
96-
value={this.state.title}
98+
value={searchTitle}
9799
onChange={this.onChangeSearchTitle}
98100
/>
99101
<div className="input-group-append">
@@ -111,12 +113,12 @@ export default class TutorialsList extends Component {
111113
<h4>Tutorials List</h4>
112114

113115
<ul className="list-group">
114-
{this.state.tutorials &&
115-
this.state.tutorials.map((tutorial, index) => (
116+
{tutorials &&
117+
tutorials.map((tutorial, index) => (
116118
<li
117119
className={
118120
"list-group-item " +
119-
(index === this.state.currentIndex ? "active" : "")
121+
(index === currentIndex ? "active" : "")
120122
}
121123
onClick={() => this.setActiveTutorial(tutorial, index)}
122124
key={index}
@@ -134,30 +136,30 @@ export default class TutorialsList extends Component {
134136
</button>
135137
</div>
136138
<div className="col-md-6">
137-
{this.state.currentTutorial ? (
139+
{currentTutorial ? (
138140
<div>
139141
<h4>Tutorial</h4>
140142
<div>
141143
<label>
142144
<strong>Title:</strong>
143145
</label>{" "}
144-
{this.state.currentTutorial.title}
146+
{currentTutorial.title}
145147
</div>
146148
<div>
147149
<label>
148150
<strong>Description:</strong>
149151
</label>{" "}
150-
{this.state.currentTutorial.description}
152+
{currentTutorial.description}
151153
</div>
152154
<div>
153155
<label>
154156
<strong>Status:</strong>
155157
</label>{" "}
156-
{this.state.currentTutorial.published ? "Published" : "Pending"}
158+
{currentTutorial.published ? "Published" : "Pending"}
157159
</div>
158160

159161
<Link
160-
to={"/tutorials/" + this.state.currentTutorial.id}
162+
to={"/tutorials/" + currentTutorial.id}
161163
className="badge badge-warning"
162164
>
163165
Edit

0 commit comments

Comments
 (0)