Skip to content

Commit bb5b321

Browse files
committed
Merge branch 'handle-error' into main
2 parents 76ad1ee + adebfb9 commit bb5b321

File tree

24 files changed

+1057
-4478
lines changed

24 files changed

+1057
-4478
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To use this template
2020
$ yarn build
2121
# or npm run start / npm run build
2222
```
23-
- Start coding
23+
- Start codinggs
2424
Demo deploy: [reactts-boilerplate.netlify.app](https://reactts-boilerplate.netlify.app/)
2525
Login
2626
username: admin
@@ -160,7 +160,7 @@ password: 123456
160160
- **App**: component App
161161
- **assets**: images, videos, files, …
162162
- **components**: contains folders components
163-
- **constansts**: contants, enum
163+
- **constansts**: constant, enum
164164
- **guards**: routes demands authenticates
165165
- **helpers**: functions helpers
166166
- **hooks**: contains hooks using

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@material-ui/core": "^4.11.0",
7-
"@material-ui/icons": "^4.9.1",
8-
"global": "^4.4.0",
9-
"immer": "^7.0.14",
10-
"netlify-cli": "^2.68.6",
6+
"@ant-design/icons": "^4.3.0",
7+
"@types/axios": "^0.14.0",
8+
"antd": "^4.8.6",
9+
"concurrently": "^5.3.0",
10+
"immer": "^8.0.0",
11+
"json-server": "^0.16.3",
1112
"react": "^17.0.1",
1213
"react-dom": "^17.0.1",
1314
"react-redux": "^7.2.2",
@@ -16,14 +17,15 @@
1617
"redux": "^4.0.5",
1718
"redux-thunk": "^2.3.0",
1819
"styled-components": "^5.2.1",
19-
"typescript": "~4.0.5"
20+
"typescript": "~4.0.5",
21+
"uuid": "^8.3.1"
2022
},
2123
"devDependencies": {
2224
"@testing-library/jest-dom": "^5.11.5",
2325
"@testing-library/react": "^11.1.1",
2426
"@testing-library/user-event": "^12.2.0",
2527
"@types/jest": "^26.0.15",
26-
"@types/node": "^14.14.7",
28+
"@types/node": "^14.14.8",
2729
"@types/react": "^16.9.56",
2830
"@types/react-dom": "^16.9.9",
2931
"@types/react-redux": "^7.1.11",
@@ -37,7 +39,9 @@
3739
"prettier": "^2.1.2"
3840
},
3941
"scripts": {
40-
"start": "react-scripts start",
42+
"json-server": "json-server --watch server/db/db.json --routes server/routes.json --port 5000",
43+
"dev": "react-scripts start",
44+
"start": "concurrently \"yarn json-server\" \"yarn dev\"",
4145
"build": "react-scripts build",
4246
"test": "react-scripts test",
4347
"eject": "react-scripts eject",

src/@types/product.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
interface Product {
2+
id: string;
3+
name: string;
4+
quantity: string;
5+
price: number;
6+
}
7+
8+
interface ResGetProductApi extends Res {
9+
data: {
10+
products: Product[];
11+
};
12+
}
13+
14+
interface ResGetProduct extends ActionRedux {
15+
payload: ResGetProductApi;
16+
}
17+
18+
interface ResGetProductItemApi extends Res {
19+
data: {
20+
product: Product;
21+
};
22+
}
23+
24+
interface ResGetProductItem extends ActionRedux {
25+
payload: ResGetProductItemApi;
26+
}

src/@types/reducer.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { RootReducer } from 'src/reducer';
2+
3+
declare global {
4+
type AppState = ReturnType<typeof RootReducer>;
5+
}

src/@types/stepForm.d.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/@types/user.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interface ReqLogin {
2+
username: string;
3+
password: string;
4+
email?: string;
5+
}
6+
interface ResLoginApi extends Res {
7+
data: {
8+
id: string;
9+
username: string;
10+
email: string;
11+
password: string;
12+
};
13+
}
14+
15+
interface IUser {
16+
id: string;
17+
username: string;
18+
email?: string;
19+
password: string;
20+
}

src/App/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import Routes from 'src/routes/routes';
2+
import { Routes } from 'src/routes';
33

44
function App() {
55
return <Routes />;

src/assets/scss/index.scss

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
1-
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
1+
@import 'config';
2+
@import 'fonts';
3+
@import 'header';
4+
@import 'footer';
5+
@import 'home';
6+
@import 'staticPages';
7+
@import 'responsive';
8+
@import 'login';
9+
10+
* {
11+
box-sizing: border-box;
12+
margin: 0;
13+
padding: 0;
14+
}
215

316
body {
4-
font-family: 'Roboto', sans-serif;
5-
font-weight: 300;
17+
font-size: 1rem;
18+
line-height: 1.6;
19+
background-color: #fff;
20+
}
21+
22+
a {
23+
text-decoration: none;
24+
color: $primary-color;
25+
}
26+
ul {
27+
list-style: none;
28+
}
29+
img {
30+
width: 100%;
31+
}
32+
33+
.container-fluid {
34+
margin: 0 auto;
35+
max-width: 100%;
36+
padding: 0 15px;
37+
}
38+
.container {
39+
margin: 0 auto;
40+
max-width: 1200px;
41+
padding: 0 15px;
42+
}
43+
44+
.ant-layout {
45+
background: #fff;
46+
}
47+
.ant-layout-content {
48+
background-color: #fff;
49+
min-height: calc(100vh - #{$heightFooter} - #{$heightHeader}) !important;
50+
padding-bottom: 2rem;
51+
overflow: auto;
52+
}
53+
.ant-layout.main-layout {
54+
background-color: #fff;
55+
}
56+
57+
p {
58+
font-size: 16px;
59+
line-height: 1.6;
660
}

src/contstants/paths.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import 'src/assets/scss/index.scss';
4+
import 'antd/dist/antd.css';
45
import App from './App/App';
56
import * as serviceWorker from './serviceWorker';
67
import { Provider } from 'react-redux';
7-
import { store } from './store/store';
8+
import { store } from './store';
89

910
ReactDOM.render(
1011
<React.StrictMode>

0 commit comments

Comments
 (0)