Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 874d88b

Browse files
Merge branch 'feature/todo' into develop
2 parents bdd7bfd + 1e3299c commit 874d88b

Some content is hidden

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

54 files changed

+17396
-10
lines changed

.env.production

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# API End points
2+
3+
REACT_APP_API_URL=http://localhost:3000/api/
4+
REACT_APP_LOGIN_URL=http://localhost:3505/

.prettierrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// prettier.config.js or .prettierrc.js
2+
module.exports = {
3+
trailingComma: 'es5',
4+
tabWidth: 4,
5+
useTabs: true,
6+
semi: true,
7+
singleQuote: true,
8+
'editor.formatOnSave': true,
9+
// printWidth: 80,
10+
proseWrap: 'always',
11+
};

package-lock.json

Lines changed: 15654 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,39 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@ant-design/icons": "^4.1.0",
67
"@testing-library/jest-dom": "^4.2.4",
78
"@testing-library/react": "^9.3.2",
89
"@testing-library/user-event": "^7.1.2",
10+
"antd": "^4.2.5",
11+
"axios": "^0.19.2",
12+
"cross-env": "^7.0.2",
13+
"formik": "^2.1.4",
14+
"formik-antd": "^2.0.1",
15+
"js-sha512": "^0.8.0",
16+
"lodash": "^4.17.15",
17+
"node-sass": "^4.14.1",
18+
"prop-types": "^15.7.2",
19+
"qs": "^6.9.4",
920
"react": "^16.13.1",
1021
"react-dom": "^16.13.1",
11-
"react-scripts": "3.4.1"
22+
"react-lottie": "^1.2.3",
23+
"react-redux": "^7.2.0",
24+
"react-router-dom": "^5.2.0",
25+
"react-scripts": "3.4.1",
26+
"redux": "^4.0.5",
27+
"redux-logger": "^3.0.6",
28+
"redux-thunk": "^2.3.0",
29+
"styled-components": "^5.1.1",
30+
"typeface-roboto": "0.0.75",
31+
"yup": "^0.29.1"
1232
},
1333
"scripts": {
14-
"start": "react-scripts start",
34+
"start": "cross-env PORT=3505 react-scripts start",
1535
"build": "react-scripts build",
1636
"test": "react-scripts test",
17-
"eject": "react-scripts eject"
37+
"eject": "react-scripts eject",
38+
"build:production": "env-cmd -f .env.production react-scripts build"
1839
},
1940
"eslintConfig": {
2041
"extends": "react-app"
@@ -31,4 +52,4 @@
3152
"last 1 safari version"
3253
]
3354
}
34-
}
55+
}

src/assets/22928-loading.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v":"5.6.5","fr":25,"ip":1,"op":100,"w":800,"h":600,"nm":"SpinnerBK","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Circle left","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":1},"o":{"x":0.121,"y":0},"t":0,"s":[270,294.71,0],"to":[0,-1.391,0],"ti":[0,5.76,0]},{"i":{"x":0.667,"y":0.954},"o":{"x":0.121,"y":0},"t":1,"s":[270,286.364,0],"to":[0,-5.76,0],"ti":[0,-3.648,0]},{"i":{"x":0.571,"y":0.995},"o":{"x":0.557,"y":0.012},"t":6,"s":[270,260.148,0],"to":[0,3.648,0],"ti":[0,-0.216,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.592,"y":0.158},"t":18,"s":[270,308.25,0],"to":[0,0.294,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":31,"s":[270,260.148,0],"to":[0,0,0],"ti":[0,0.468,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":44,"s":[270,308.25,0],"to":[0,-0.569,0],"ti":[0,0,0]},{"i":{"x":0.718,"y":0.979},"o":{"x":0.333,"y":0},"t":56,"s":[270,260.148,0],"to":[0,0,0],"ti":[0,0.468,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":69,"s":[270,308.25,0],"to":[0,-0.569,0],"ti":[0,2.175,0]},{"i":{"x":0.617,"y":0.989},"o":{"x":0.333,"y":0},"t":82,"s":[270,260.148,0],"to":[0,-2.175,0],"ti":[0,0.114,0]},{"i":{"x":0.764,"y":0},"o":{"x":0.329,"y":0.395},"t":95,"s":[270,295.2,0],"to":[0,-0.189,0],"ti":[0,0,0]},{"t":149,"s":[270,291.71,0]}],"ix":2},"a":{"a":0,"k":[-128,76,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[62.348,62.348],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.592156982422,0.721568986481,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":24,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[0.709803938866,0.941176533699,0.937254965305,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":37,"s":[0.709803938866,0.941176533699,0.937254965305,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":38,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":49,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":50,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":61,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":62,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":74,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":75,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":87,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"t":88,"s":[0.96862745285,0.411764711142,0,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-127.826,76.852],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":-64,"op":150,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Circle central","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":1},"o":{"x":0,"y":0},"t":0,"s":[399.5,295.21,0],"to":[0,-0.782,0],"ti":[0,5.844,0]},{"i":{"x":0.667,"y":1},"o":{"x":0,"y":0},"t":1,"s":[399.5,290.518,0],"to":[0,-5.844,0],"ti":[0,-2.955,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":12,"s":[399.5,260.148,0],"to":[0,2.955,0],"ti":[0,-5,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":24,"s":[399.5,308.25,0],"to":[0,1.086,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":37,"s":[399.5,260.148,0],"to":[0,0,0],"ti":[0,-4.971,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":50,"s":[399.5,308.25,0],"to":[0,1.241,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":62,"s":[399.5,260.148,0],"to":[0,0,0],"ti":[0,-5.062,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":75,"s":[399.5,308.25,0],"to":[0,5.062,0],"ti":[0,-5.344,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":88,"s":[399.5,290.518,0],"to":[0,0.013,0],"ti":[0,-0.013,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":95,"s":[399.5,295.2,0],"to":[0,0.04,0],"ti":[0,-0.279,0]},{"t":149,"s":[399.5,292.21,0]}],"ix":2},"a":{"a":0,"k":[-127.5,76.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[62.348,62.348],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.592156982422,0.721568986481,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[0.996078491211,0.831372618675,0.1882353127,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":24,"s":[0.996078491211,0.831372618675,0.1882353127,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":37,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":38,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":49,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":50,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":61,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":62,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":74,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":75,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":80,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":87,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"t":88,"s":[0.996078431606,0.831372559071,0.188235297799,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-127.826,76.852],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":150,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Circle right","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":1},"o":{"x":0,"y":0},"t":0,"s":[527.5,295.21,0],"to":[0,2.173,0],"ti":[0,5.844,0]},{"i":{"x":0.667,"y":1},"o":{"x":0,"y":0},"t":4,"s":[527.5,308.25,0],"to":[0,-5.844,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":17,"s":[527.5,260.148,0],"to":[0,0,0],"ti":[0,-5.138,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":31,"s":[527.5,308.25,0],"to":[0,1.113,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":44,"s":[527.5,260.148,0],"to":[0,0,0],"ti":[0,-5.138,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":56,"s":[527.5,308.25,0],"to":[0,0.514,0],"ti":[0,1.5,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0.167},"t":69,"s":[527.5,260.148,0],"to":[0,-1.5,0],"ti":[0,-5.842,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":81,"s":[527.5,299.25,0],"to":[0,5.842,0],"ti":[0,0,0]},{"t":95,"s":[527.5,295.2,0]}],"ix":2},"a":{"a":0,"k":[-128,76.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[62.348,62.348],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Trazado elíptico 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.592156982422,0.721568986481,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Trazo 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":12,"s":[0.709803921569,0.941176530427,0.937254961799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":24,"s":[0.709803921569,0.941176530427,0.937254961799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[0.996078491211,0.831372618675,0.1882353127,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":37,"s":[0.996078491211,0.831372618675,0.1882353127,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":38,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":49,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":50,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":61,"s":[0.709803938866,0.941176474094,0.937254905701,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":62,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":74,"s":[0.996078431606,0.831372559071,0.188235297799,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":75,"s":[0.96862745285,0.411764711142,0,1]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":87,"s":[0.96862745285,0.411764711142,0,1]},{"t":88,"s":[0.709803938866,0.941176474094,1,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Relleno 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-127.826,76.852],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transformar"}],"nm":"Elipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":150,"st":0,"bm":0}],"markers":[]}

src/assets/Loader.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v":"5.5.5","fr":30,"ip":0,"op":300,"w":1920,"h":1080,"nm":"loader","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[960,540,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[678,678],"ix":2},"p":{"a":0,"k":[0,34],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":30,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":7,"s":[0]},{"t":37,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0,0.5686274509803921,0.7764705882352941,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":59,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[-7,22],"ix":2},"a":{"a":0,"k":[-13.96,41.879],"ix":1},"s":{"a":0,"k":[85.962,85.962],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[678,678],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":4,"s":[0]},{"t":33,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":12,"s":[0]},{"t":40,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.403921568627451,0.7098039215686275,0.29411764705882354,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":59,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[6,15],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[85.962,85.962],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 2","np":4,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[678,678],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":35,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":17,"s":[0]},{"t":43,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.5098039215686274,0.7529411764705882,0.4117647058823529,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":59,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[6,15],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[85.962,85.962],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 3","np":4,"cix":2,"bm":0,"ix":3,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"Loader comp","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[960,540,0],"ix":2},"a":{"a":0,"k":[960,540,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"tm":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":43,"s":[1.433]}],"ix":2,"x":"var $bm_rt;\n$bm_rt = loopOut('cycle');"},"w":1920,"h":1080,"ip":0,"op":313,"st":0,"bm":0}],"markers":[]}

src/components/common/AuthRoute.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { useSelector } from 'react-redux';
3+
import { Route, Redirect } from 'react-router-dom';
4+
import { SESSION } from '../../services';
5+
6+
function AuthRoute({ children, ...rest }) {
7+
const { recentlyVisitedUrl } = useSelector((state) => state.history);
8+
9+
if (SESSION.isLoggedIn()) {
10+
return (
11+
<Redirect
12+
to={{
13+
pathname: recentlyVisitedUrl,
14+
}}
15+
/>
16+
);
17+
} else {
18+
return <Route {...rest}>{children}</Route>;
19+
}
20+
}
21+
22+
export default AuthRoute;

src/components/common/FormDebug.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React from 'react';
2+
import { FormikConsumer } from 'formik';
3+
4+
export const Debug = () => (
5+
<div
6+
style={{
7+
margin: '3rem 0',
8+
borderRadius: 4,
9+
background: '#f6f8fa',
10+
11+
boxShadow: '0 0 1px #eee inset',
12+
}}
13+
>
14+
<div
15+
style={{
16+
textTransform: 'uppercase',
17+
fontSize: 11,
18+
borderTopLeftRadius: 4,
19+
borderTopRightRadius: 4,
20+
fontWeight: 500,
21+
padding: '.5rem',
22+
background: '#555',
23+
color: '#fff',
24+
letterSpacing: '1px',
25+
}}
26+
>
27+
Formik State
28+
</div>
29+
<FormikConsumer>
30+
{({ validationSchema, validate, onSubmit, ...rest }) => (
31+
<pre
32+
style={{
33+
fontSize: '.65rem',
34+
padding: '.25rem .5rem',
35+
overflowX: 'scroll',
36+
}}
37+
>
38+
{JSON.stringify(rest, null, 2)}
39+
</pre>
40+
)}
41+
</FormikConsumer>
42+
</div>
43+
);

src/components/common/Loader.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from 'react';
2+
import { useSelector } from 'react-redux';
3+
import Lottie from 'react-lottie';
4+
import animationData from '../../assets/22928-loading.json';
5+
6+
export default function Loader() {
7+
const loader = useSelector((state) => state.api.showLoader);
8+
9+
const defaultOptions = {
10+
loop: true,
11+
autoplay: true,
12+
animationData: animationData,
13+
rendererSettings: {
14+
preserveAspectRatio: 'xMidYMid slice',
15+
},
16+
};
17+
18+
return (
19+
<>
20+
{loader && (
21+
<div className="loaderbox">
22+
<Lottie options={defaultOptions} height={128} width={128} />
23+
</div>
24+
)}
25+
</>
26+
);
27+
}

src/components/common/PrivateRoute.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import React, { useEffect } from 'react';
2+
import { Route } from 'react-router-dom';
3+
import { Layout } from 'antd';
4+
import { useDispatch } from 'react-redux';
5+
import { SESSION } from '../../services';
6+
import { Sidebar } from '../common';
7+
8+
const { Content } = Layout;
9+
10+
function PrivateRoute({ children, location, ...rest }) {
11+
const dispatch = useDispatch();
12+
const { pathname } = location;
13+
14+
useEffect(() => {
15+
return () => {
16+
/**
17+
* to set last visited page url in redux store
18+
*/
19+
dispatch({
20+
type: 'SET_HISTORY_RECENT',
21+
payload: pathname,
22+
});
23+
};
24+
// eslint-disable-next-line react-hooks/exhaustive-deps
25+
}, [pathname]);
26+
27+
if (SESSION.isLoggedIn()) {
28+
return (
29+
<Layout>
30+
<Sidebar />
31+
<Content>
32+
<div className="p-10 height-100">
33+
<Route {...rest}>{children}</Route>
34+
</div>
35+
</Content>
36+
</Layout>
37+
);
38+
} else {
39+
SESSION.logout();
40+
}
41+
}
42+
43+
export default PrivateRoute;

0 commit comments

Comments
 (0)