Skip to content

Commit 76ad1ee

Browse files
committed
Update old files
1 parent 0b45f16 commit 76ad1ee

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1739
-0
lines changed

server/db/db.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"users": [
3+
{
4+
"id": "idtest",
5+
"username": "tester",
6+
"email": "tester@gmail.com",
7+
"password": "123456"
8+
},
9+
{
10+
"id": "d18eca47-e1fb-4259-b2b7-9cf2ead4ba29",
11+
"username": "tienduy",
12+
"email": "tienduy@gmail.com",
13+
"password": "123456"
14+
},
15+
{
16+
"id": "d3dda531-1893-4ffa-972e-c3d55541f7d5",
17+
"username": "alan",
18+
"email": "alan@gmail.com",
19+
"password": "123456"
20+
}
21+
],
22+
"products": []
23+
}

server/routes.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"/api/*": "/$1"
3+
}

src/App/App.actions.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import * as types from './App.constants';
2+
3+
export const logout = () => ({
4+
type: types.LOGOUT,
5+
});
6+
7+
export const toggleSideNav = () => ({
8+
type: types.CLOSE_SIDE_NAV,
9+
});

src/App/App.constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const LOGOUT = 'app/LOGOUT';
2+
export const CLOSE_SIDE_NAV = 'app/CLOSE_SIDE_NAV';

src/App/App.reducer.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as types from './App.constants';
2+
import { LOGIN_SUCCESS } from 'src/components/Auth/Auth.constants';
3+
import produce from 'immer';
4+
5+
const initialState = {
6+
isAuthenticated: false,
7+
closeSideNav: false,
8+
};
9+
10+
export const AppReducer = (state = initialState, action) =>
11+
produce(state, draft => {
12+
switch (action.type) {
13+
case types.LOGOUT:
14+
localStorage.removeItem('token');
15+
draft.isAuthenticated = false;
16+
break;
17+
case LOGIN_SUCCESS:
18+
draft.isAuthenticated = true;
19+
break;
20+
case types.CLOSE_SIDE_NAV:
21+
draft.closeSideNav = !state.closeSideNav;
22+
break;
23+
default:
24+
return state;
25+
}
26+
});

src/assets/images/home.jpeg

129 KB
Loading

src/assets/images/home2.jpeg

52.7 KB
Loading
83.6 KB
Loading

src/assets/scss/_config.scss

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
$primary-color: #1890ff;
2+
$dark-color: #111;
3+
$light-color: #f4f4f4;
4+
$white-color: #fff;
5+
$danger-color: #e23c39;
6+
$success-color: #70c040;
7+
$warning-color: #efaf41;
8+
9+
$max-width: 1200px;
10+
$heightHeader: 60px;
11+
$heightFooter: 150px;
12+
13+
//Margin & Padding
14+
$spaceamounts: (1, 2, 3, 4, 5);
15+
@each $space in $spaceamounts {
16+
// All around margin
17+
.m-#{$space} {
18+
margin: #{$space}rem;
19+
}
20+
// Vertical margin
21+
.my-#{$space} {
22+
margin: #{$space}rem 0;
23+
}
24+
// Horizontal margin
25+
.mx-#{$space} {
26+
margin: 0 #{$space}rem;
27+
}
28+
// Margin-left
29+
.ml-#{$space} {
30+
margin-left: #{$space}rem;
31+
}
32+
// Margin-right
33+
.mr-#{$space} {
34+
margin-right: #{$space}rem;
35+
}
36+
// Margin-top
37+
.mt-#{$space} {
38+
margin-top: #{$space}rem;
39+
}
40+
// Margin-right
41+
.mb-#{$space} {
42+
margin-bottom: #{$space}rem;
43+
}
44+
45+
// All around padding
46+
.p-#{$space} {
47+
padding: #{$space}rem;
48+
}
49+
// Vertical padding
50+
.py-#{$space} {
51+
padding: #{$space}rem 0;
52+
}
53+
// Horizontal padding
54+
.px-#{$space} {
55+
padding: 0 #{$space}rem;
56+
}
57+
// padding-left
58+
.mp-#{$space} {
59+
padding-left: #{$space}rem;
60+
}
61+
// padding-right
62+
.pr-#{$space} {
63+
padding-right: #{$space}rem;
64+
}
65+
// padding-top
66+
.pt-#{$space} {
67+
padding-top: #{$space}rem;
68+
}
69+
// Margin-right
70+
.pb-#{$space} {
71+
padding-bottom: #{$space}rem;
72+
}
73+
}

src/assets/scss/_fonts.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
2+
3+
body {
4+
font-family: 'Roboto', sans-serif;
5+
font-weight: 300;
6+
}

0 commit comments

Comments
 (0)