Compare commits

...

No commits in common. 'master' and 'Login-branch' have entirely different histories.

  1. 206
      package-lock.json
  2. 11
      package.json
  3. 19
      src/App.js
  4. 61
      src/login.jsx

206
package-lock.json generated

@ -8,12 +8,12 @@
"name": "dashboard", "name": "dashboard",
"version": "0.1.0", "version": "0.1.0",
"dependencies": { "dependencies": {
"@emotion/react": "^11.11.0", "@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0", "@emotion/styled": "^11.11.0",
"@fullcalendar/react": "^6.1.8", "@fullcalendar/react": "^6.1.8",
"@mui/icons-material": "^5.11.16", "@mui/icons-material": "^5.11.16",
"@mui/material": "^5.13.3", "@mui/material": "^5.13.4",
"@mui/x-data-grid": "^6.5.0", "@mui/x-data-grid": "^6.7.0",
"@nivo/bar": "^0.83.0", "@nivo/bar": "^0.83.0",
"@nivo/core": "^0.83.0", "@nivo/core": "^0.83.0",
"@nivo/geo": "^0.83.0", "@nivo/geo": "^0.83.0",
@ -22,12 +22,13 @@
"@testing-library/jest-dom": "^5.16.5", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"formik": "^2.4.0", "axios": "^1.4.0",
"formik": "^2.4.1",
"fullcalendar": "^6.1.8", "fullcalendar": "^6.1.8",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-pro-sidebar": "^0.7.1", "react-pro-sidebar": "^0.7.1",
"react-router-dom": "^6.11.2", "react-router-dom": "^6.12.1",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"web-vitals": "^2.1.4", "web-vitals": "^2.1.4",
"yup": "^1.2.0" "yup": "^1.2.0"
@ -2377,9 +2378,9 @@
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
}, },
"node_modules/@emotion/react": { "node_modules/@emotion/react": {
"version": "11.11.0", "version": "11.11.1",
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.0.tgz", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz",
"integrity": "sha512-ZSK3ZJsNkwfjT3JpDAWJZlrGD81Z3ytNDsxw1LKq1o+xkmO5pnWfr6gmCC8gHEFf3nSSX/09YrG67jybNPxSUw==", "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.18.3", "@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.11.0", "@emotion/babel-plugin": "^11.11.0",
@ -3393,15 +3394,15 @@
"integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A=="
}, },
"node_modules/@mui/base": { "node_modules/@mui/base": {
"version": "5.0.0-beta.3", "version": "5.0.0-beta.4",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.3.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.4.tgz",
"integrity": "sha512-ErOMoGNpgf6BF5W+jgXDiRlXJnpSeg8XSRonuY5UCCMHIlOWtKDtt/LS3qDAbFFGb7tV/y6EBddbcMeexx+zHw==", "integrity": "sha512-ejhtqYJpjDgHGEljjMBQWZ22yEK0OzIXNa7toJmmXsP4TT3W7xVy8bTJ0TniPDf+JNjrsgfgiFTDGdlEhV1E+g==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@emotion/is-prop-valid": "^1.2.1", "@emotion/is-prop-valid": "^1.2.1",
"@mui/types": "^7.2.4", "@mui/types": "^7.2.4",
"@mui/utils": "^5.13.1", "@mui/utils": "^5.13.1",
"@popperjs/core": "^2.11.7", "@popperjs/core": "^2.11.8",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react-is": "^18.2.0" "react-is": "^18.2.0"
@ -3430,9 +3431,9 @@
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
}, },
"node_modules/@mui/core-downloads-tracker": { "node_modules/@mui/core-downloads-tracker": {
"version": "5.13.3", "version": "5.13.4",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.3.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.4.tgz",
"integrity": "sha512-w4//nRIi9fiMow/MmhkForOezd8nc229EpSZZ5DzwpJNOmAXwypFTapOUVAGTUQiTJyeZXUNbQqYuUIrIs2nbg==", "integrity": "sha512-yFrMWcrlI0TqRN5jpb6Ma9iI7sGTHpytdzzL33oskFHNQ8UgrtPas33Y1K7sWAMwCrr1qbWDrOHLAQG4tAzuSw==",
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/mui" "url": "https://opencollective.com/mui"
@ -3464,13 +3465,13 @@
} }
}, },
"node_modules/@mui/material": { "node_modules/@mui/material": {
"version": "5.13.3", "version": "5.13.4",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.3.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.4.tgz",
"integrity": "sha512-10pek+Bz+PZ4rjUf3KTKfXWjPMUqU1nSnRPf4DAXABhsjzelGGfGW/EICgrLRrttYplTJZhoponWALezAge8ug==", "integrity": "sha512-Yq+4f1KLPa/Szd3xqra2hbOAf2Usl8GbubncArM6LIp40mBLtXIdPE29MNtHsbtuzz4g+eidrETgoi3wdbEYfQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@mui/base": "5.0.0-beta.3", "@mui/base": "5.0.0-beta.4",
"@mui/core-downloads-tracker": "^5.13.3", "@mui/core-downloads-tracker": "^5.13.4",
"@mui/system": "^5.13.2", "@mui/system": "^5.13.2",
"@mui/types": "^7.2.4", "@mui/types": "^7.2.4",
"@mui/utils": "^5.13.1", "@mui/utils": "^5.13.1",
@ -3649,12 +3650,12 @@
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
}, },
"node_modules/@mui/x-data-grid": { "node_modules/@mui/x-data-grid": {
"version": "6.5.0", "version": "6.7.0",
"resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.5.0.tgz", "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.7.0.tgz",
"integrity": "sha512-S90o+hwUvm0XC/tCyqSMpL3fGzYSF3P1FfybZPCe3ayVQVV/aR0LQUbfUEHlHUv49qUJ+y9c/QsElrr7BsYrNw==", "integrity": "sha512-gkMjvIT2oMKs7VOxLXxu0NkSKFBhlh/AepHB89xKcf+XVMkKBEwq8VT2GtrccAO+7Lr7ciZhcX2EmiDHsXdhbA==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@mui/utils": "^5.12.3", "@mui/utils": "^5.13.1",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"reselect": "^4.1.8" "reselect": "^4.1.8"
@ -3669,8 +3670,8 @@
"peerDependencies": { "peerDependencies": {
"@mui/material": "^5.4.1", "@mui/material": "^5.4.1",
"@mui/system": "^5.4.1", "@mui/system": "^5.4.1",
"react": "^17.0.2 || ^18.0.0", "react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0" "react-dom": "^17.0.0 || ^18.0.0"
} }
}, },
"node_modules/@nicolo-ribaudo/eslint-scope-5-internals": { "node_modules/@nicolo-ribaudo/eslint-scope-5-internals": {
@ -4108,9 +4109,9 @@
} }
}, },
"node_modules/@remix-run/router": { "node_modules/@remix-run/router": {
"version": "1.6.2", "version": "1.6.3",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.2.tgz", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.3.tgz",
"integrity": "sha512-LzqpSrMK/3JBAVBI9u3NWtOhWNw5AMQfrUFYB0+bDHTSw17z++WJLsPsxAuK+oSddsxk4d7F/JcdDPM1M5YAhA==", "integrity": "sha512-EXJysQ7J3veRECd0kZFQwYYd5sJMcq2O/m60zu1W2l3oVQ9xtub8jTOtYRE0+M2iomyG/W3Ps7+vp2kna0C27Q==",
"engines": { "engines": {
"node": ">=14" "node": ">=14"
} }
@ -6166,6 +6167,29 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/axios": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/axios/node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/axobject-query": { "node_modules/axobject-query": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
@ -9529,9 +9553,9 @@
} }
}, },
"node_modules/formik": { "node_modules/formik": {
"version": "2.4.0", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/formik/-/formik-2.4.0.tgz", "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.1.tgz",
"integrity": "sha512-QZiWztt9fD84EYcF7Bmr431ZhIm1xUVgBACbTuJ6azPrUpVp7o6q+t9HJaIQsFZrMfcBPNBotYtDgyDpzQ3z0Q==", "integrity": "sha512-ajOB9EmFhXb4PACTlaooVEn7PLtLtBJEZ8fPs+wFZjL5KSGwgAoU+n9DHN8JcqNKcXkloEYYtn1lxrLav18ecQ==",
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@ -15387,6 +15411,11 @@
"node": ">= 0.10" "node": ">= 0.10"
} }
}, },
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/psl": { "node_modules/psl": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
@ -15716,11 +15745,11 @@
} }
}, },
"node_modules/react-router": { "node_modules/react-router": {
"version": "6.11.2", "version": "6.12.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.11.2.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.12.1.tgz",
"integrity": "sha512-74z9xUSaSX07t3LM+pS6Un0T55ibUE/79CzfZpy5wsPDZaea1F8QkrsiyRnA2YQ7LwE/umaydzXZV80iDCPkMg==", "integrity": "sha512-evd/GrKJOeOypD0JB9e1r7pQh2gWCsTbUfq059Wm1AFT/K2MNZuDo19lFtAgIhlBrp0MmpgpqtvZC7LPAs7vSw==",
"dependencies": { "dependencies": {
"@remix-run/router": "1.6.2" "@remix-run/router": "1.6.3"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"
@ -15730,12 +15759,12 @@
} }
}, },
"node_modules/react-router-dom": { "node_modules/react-router-dom": {
"version": "6.11.2", "version": "6.12.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.11.2.tgz", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.12.1.tgz",
"integrity": "sha512-JNbKtAeh1VSJQnH6RvBDNhxNwemRj7KxCzc5jb7zvDSKRnPWIFj9pO+eXqjM69gQJ0r46hSz1x4l9y0651DKWw==", "integrity": "sha512-POIZN9UDKWwEDga054LvYr2KnK8V+0HR4Ny4Bwv8V7/FZCPxJgsCjYxXGxqxzHs7VBxMKZfgvtKhafuJkJSPGA==",
"dependencies": { "dependencies": {
"@remix-run/router": "1.6.2", "@remix-run/router": "1.6.3",
"react-router": "6.11.2" "react-router": "6.12.1"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"
@ -20291,9 +20320,9 @@
"integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA=="
}, },
"@emotion/react": { "@emotion/react": {
"version": "11.11.0", "version": "11.11.1",
"resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.0.tgz", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz",
"integrity": "sha512-ZSK3ZJsNkwfjT3JpDAWJZlrGD81Z3ytNDsxw1LKq1o+xkmO5pnWfr6gmCC8gHEFf3nSSX/09YrG67jybNPxSUw==", "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==",
"requires": { "requires": {
"@babel/runtime": "^7.18.3", "@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.11.0", "@emotion/babel-plugin": "^11.11.0",
@ -21044,15 +21073,15 @@
"integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A=="
}, },
"@mui/base": { "@mui/base": {
"version": "5.0.0-beta.3", "version": "5.0.0-beta.4",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.3.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.4.tgz",
"integrity": "sha512-ErOMoGNpgf6BF5W+jgXDiRlXJnpSeg8XSRonuY5UCCMHIlOWtKDtt/LS3qDAbFFGb7tV/y6EBddbcMeexx+zHw==", "integrity": "sha512-ejhtqYJpjDgHGEljjMBQWZ22yEK0OzIXNa7toJmmXsP4TT3W7xVy8bTJ0TniPDf+JNjrsgfgiFTDGdlEhV1E+g==",
"requires": { "requires": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@emotion/is-prop-valid": "^1.2.1", "@emotion/is-prop-valid": "^1.2.1",
"@mui/types": "^7.2.4", "@mui/types": "^7.2.4",
"@mui/utils": "^5.13.1", "@mui/utils": "^5.13.1",
"@popperjs/core": "^2.11.7", "@popperjs/core": "^2.11.8",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react-is": "^18.2.0" "react-is": "^18.2.0"
@ -21066,9 +21095,9 @@
} }
}, },
"@mui/core-downloads-tracker": { "@mui/core-downloads-tracker": {
"version": "5.13.3", "version": "5.13.4",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.3.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.13.4.tgz",
"integrity": "sha512-w4//nRIi9fiMow/MmhkForOezd8nc229EpSZZ5DzwpJNOmAXwypFTapOUVAGTUQiTJyeZXUNbQqYuUIrIs2nbg==" "integrity": "sha512-yFrMWcrlI0TqRN5jpb6Ma9iI7sGTHpytdzzL33oskFHNQ8UgrtPas33Y1K7sWAMwCrr1qbWDrOHLAQG4tAzuSw=="
}, },
"@mui/icons-material": { "@mui/icons-material": {
"version": "5.11.16", "version": "5.11.16",
@ -21079,13 +21108,13 @@
} }
}, },
"@mui/material": { "@mui/material": {
"version": "5.13.3", "version": "5.13.4",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.3.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.13.4.tgz",
"integrity": "sha512-10pek+Bz+PZ4rjUf3KTKfXWjPMUqU1nSnRPf4DAXABhsjzelGGfGW/EICgrLRrttYplTJZhoponWALezAge8ug==", "integrity": "sha512-Yq+4f1KLPa/Szd3xqra2hbOAf2Usl8GbubncArM6LIp40mBLtXIdPE29MNtHsbtuzz4g+eidrETgoi3wdbEYfQ==",
"requires": { "requires": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@mui/base": "5.0.0-beta.3", "@mui/base": "5.0.0-beta.4",
"@mui/core-downloads-tracker": "^5.13.3", "@mui/core-downloads-tracker": "^5.13.4",
"@mui/system": "^5.13.2", "@mui/system": "^5.13.2",
"@mui/types": "^7.2.4", "@mui/types": "^7.2.4",
"@mui/utils": "^5.13.1", "@mui/utils": "^5.13.1",
@ -21166,12 +21195,12 @@
} }
}, },
"@mui/x-data-grid": { "@mui/x-data-grid": {
"version": "6.5.0", "version": "6.7.0",
"resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.5.0.tgz", "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.7.0.tgz",
"integrity": "sha512-S90o+hwUvm0XC/tCyqSMpL3fGzYSF3P1FfybZPCe3ayVQVV/aR0LQUbfUEHlHUv49qUJ+y9c/QsElrr7BsYrNw==", "integrity": "sha512-gkMjvIT2oMKs7VOxLXxu0NkSKFBhlh/AepHB89xKcf+XVMkKBEwq8VT2GtrccAO+7Lr7ciZhcX2EmiDHsXdhbA==",
"requires": { "requires": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@mui/utils": "^5.12.3", "@mui/utils": "^5.13.1",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"reselect": "^4.1.8" "reselect": "^4.1.8"
@ -21506,9 +21535,9 @@
} }
}, },
"@remix-run/router": { "@remix-run/router": {
"version": "1.6.2", "version": "1.6.3",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.2.tgz", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.6.3.tgz",
"integrity": "sha512-LzqpSrMK/3JBAVBI9u3NWtOhWNw5AMQfrUFYB0+bDHTSw17z++WJLsPsxAuK+oSddsxk4d7F/JcdDPM1M5YAhA==" "integrity": "sha512-EXJysQ7J3veRECd0kZFQwYYd5sJMcq2O/m60zu1W2l3oVQ9xtub8jTOtYRE0+M2iomyG/W3Ps7+vp2kna0C27Q=="
}, },
"@rollup/plugin-babel": { "@rollup/plugin-babel": {
"version": "5.3.1", "version": "5.3.1",
@ -23071,6 +23100,28 @@
"resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz", "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.7.2.tgz",
"integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g==" "integrity": "sha512-zIURGIS1E1Q4pcrMjp+nnEh+16G56eG/MUllJH8yEvw7asDo7Ac9uhC9KIH5jzpITueEZolfYglnCGIuSBz39g=="
}, },
"axios": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz",
"integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==",
"requires": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
},
"dependencies": {
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
}
}
},
"axobject-query": { "axobject-query": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
@ -25575,9 +25626,9 @@
} }
}, },
"formik": { "formik": {
"version": "2.4.0", "version": "2.4.1",
"resolved": "https://registry.npmjs.org/formik/-/formik-2.4.0.tgz", "resolved": "https://registry.npmjs.org/formik/-/formik-2.4.1.tgz",
"integrity": "sha512-QZiWztt9fD84EYcF7Bmr431ZhIm1xUVgBACbTuJ6azPrUpVp7o6q+t9HJaIQsFZrMfcBPNBotYtDgyDpzQ3z0Q==", "integrity": "sha512-ajOB9EmFhXb4PACTlaooVEn7PLtLtBJEZ8fPs+wFZjL5KSGwgAoU+n9DHN8JcqNKcXkloEYYtn1lxrLav18ecQ==",
"requires": { "requires": {
"deepmerge": "^2.1.1", "deepmerge": "^2.1.1",
"hoist-non-react-statics": "^3.3.0", "hoist-non-react-statics": "^3.3.0",
@ -29620,6 +29671,11 @@
} }
} }
}, },
"proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"psl": { "psl": {
"version": "1.9.0", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
@ -29863,20 +29919,20 @@
"integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A=="
}, },
"react-router": { "react-router": {
"version": "6.11.2", "version": "6.12.1",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.11.2.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.12.1.tgz",
"integrity": "sha512-74z9xUSaSX07t3LM+pS6Un0T55ibUE/79CzfZpy5wsPDZaea1F8QkrsiyRnA2YQ7LwE/umaydzXZV80iDCPkMg==", "integrity": "sha512-evd/GrKJOeOypD0JB9e1r7pQh2gWCsTbUfq059Wm1AFT/K2MNZuDo19lFtAgIhlBrp0MmpgpqtvZC7LPAs7vSw==",
"requires": { "requires": {
"@remix-run/router": "1.6.2" "@remix-run/router": "1.6.3"
} }
}, },
"react-router-dom": { "react-router-dom": {
"version": "6.11.2", "version": "6.12.1",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.11.2.tgz", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.12.1.tgz",
"integrity": "sha512-JNbKtAeh1VSJQnH6RvBDNhxNwemRj7KxCzc5jb7zvDSKRnPWIFj9pO+eXqjM69gQJ0r46hSz1x4l9y0651DKWw==", "integrity": "sha512-POIZN9UDKWwEDga054LvYr2KnK8V+0HR4Ny4Bwv8V7/FZCPxJgsCjYxXGxqxzHs7VBxMKZfgvtKhafuJkJSPGA==",
"requires": { "requires": {
"@remix-run/router": "1.6.2", "@remix-run/router": "1.6.3",
"react-router": "6.11.2" "react-router": "6.12.1"
} }
}, },
"react-scripts": { "react-scripts": {

11
package.json

@ -3,12 +3,12 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@emotion/react": "^11.11.0", "@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0", "@emotion/styled": "^11.11.0",
"@fullcalendar/react": "^6.1.8", "@fullcalendar/react": "^6.1.8",
"@mui/icons-material": "^5.11.16", "@mui/icons-material": "^5.11.16",
"@mui/material": "^5.13.3", "@mui/material": "^5.13.4",
"@mui/x-data-grid": "^6.5.0", "@mui/x-data-grid": "^6.7.0",
"@nivo/bar": "^0.83.0", "@nivo/bar": "^0.83.0",
"@nivo/core": "^0.83.0", "@nivo/core": "^0.83.0",
"@nivo/geo": "^0.83.0", "@nivo/geo": "^0.83.0",
@ -17,12 +17,13 @@
"@testing-library/jest-dom": "^5.16.5", "@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0", "@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0", "@testing-library/user-event": "^13.5.0",
"formik": "^2.4.0", "axios": "^1.4.0",
"formik": "^2.4.1",
"fullcalendar": "^6.1.8", "fullcalendar": "^6.1.8",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-pro-sidebar": "^0.7.1", "react-pro-sidebar": "^0.7.1",
"react-router-dom": "^6.11.2", "react-router-dom": "^6.12.1",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"web-vitals": "^2.1.4", "web-vitals": "^2.1.4",
"yup": "^1.2.0" "yup": "^1.2.0"

19
src/App.js

@ -2,6 +2,8 @@ import Topbar from "./scenes/global/Topbar";
import { CssBaseline, ThemeProvider } from "@mui/material"; import { CssBaseline, ThemeProvider } from "@mui/material";
import { ColorModeContext, useMode } from "./theme"; import { ColorModeContext, useMode } from "./theme";
import { Routes, Route } from "react-router-dom"; import { Routes, Route } from "react-router-dom";
import { Login } from './login';
import { useLocation } from "react-router-dom";
import Sidebar from "./scenes/global/Sidebar"; import Sidebar from "./scenes/global/Sidebar";
import Dashboard from "./scenes/dashboard"; import Dashboard from "./scenes/dashboard";
import Team from "./scenes/team"; import Team from "./scenes/team";
@ -18,17 +20,21 @@ import Calendar from "./scenes/calender";
function App() { function App() {
const [theme, colorMode] = useMode(); const [theme, colorMode] = useMode();
const location = useLocation();
const isLoginPage = location.pathname === '/';
return ( return (
<ColorModeContext.Provider value={colorMode}> <ColorModeContext.Provider value={colorMode}>
<ThemeProvider theme={theme}> <ThemeProvider theme={theme}>
<CssBaseline /> <CssBaseline />
<div className="app"> <div className="app">
<Sidebar /> {!isLoginPage && <Sidebar />}
<main className="content"> <main className={isLoginPage ? 'content_login' : 'content'}>
<Topbar/> {!isLoginPage && <Topbar />}
<Routes> <Routes>
<Route path="/" element = {<Dashboard />} /> <Route path="/" element={<Login />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/team" element = {<Team/>} /> <Route path="/team" element = {<Team/>} />
<Route path="/contacts" element = {<Contacts />} /> <Route path="/contacts" element = {<Contacts />} />
<Route path="/invoices" element = {<Invoices />} /> <Route path="/invoices" element = {<Invoices />} />
@ -36,9 +42,8 @@ function App() {
<Route path="/faq" element = {<FAQ/>} /> <Route path="/faq" element = {<FAQ/>} />
<Route path="/bar" element = {<Bar />} /> <Route path="/bar" element = {<Bar />} />
<Route path="/line" element = {<Line />} /> <Route path="/line" element = {<Line />} />
<Route path="/pie" element = {<Pie />} /> <Route path="/pie" element = {<Pie />} />
<Route path="/geography" element = {<Geography />} />
<Route path="/geography" element = {<Geography />} />
<Route path="/calendar" element = {<Calendar />} /> <Route path="/calendar" element = {<Calendar />} />
</Routes> </Routes>
</main> </main>

61
src/login.jsx

@ -0,0 +1,61 @@
import React, { useState } from 'react';
import axios from 'axios';
import { useNavigate } from 'react-router-dom';
export const Login = (props) => {
const [username, setUsername] = useState('');
const [password, setPass] = useState('');
const baseURL = 'https://adw-api.ospro.id/api/login';
const navigate = useNavigate();
const handleSubmit = (e) => {
e.preventDefault();
axios
.post(baseURL, {
username: username,
password: password,
})
.then((response) => {
console.log("test", response.data.data.data_user.name);
if (response.status === 200) {
navigate('/dashboard');
}
})
.catch((error) => {
console.error('Error during login:', error);
});
};
return (
<div className="form-container">
<h2 className="judul">Login</h2>
<form className="login" onSubmit={handleSubmit}>
<label htmlFor="username"> Username</label>
<input
type="text"
placeholder="type here.."
id="username"
name="username"
value={username}
onChange={(e) => setUsername(e.target.value)}
/>
<label htmlFor="password"> Password</label>
<input
type="password"
placeholder="******"
id="password"
name="password"
value={password}
onChange={(e) => setPass(e.target.value)}
/>
<button className="login-btn" type="submit">
Log In
</button>
</form>
<button className="link-btn" onClick={() => props.onFormSwitch('register')}>
Don't have an account? Register here
</button>
</div>
);
};
Loading…
Cancel
Save