Косметические изменения

This commit is contained in:
goodmice 2022-04-29 18:38:49 +05:00
parent dd2315d53e
commit 9d6e5b0687
7 changed files with 41 additions and 32 deletions

37
package-lock.json generated
View File

@ -13,6 +13,7 @@
"@testing-library/jest-dom": "^5.11.10", "@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.6", "@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^12.8.3", "@testing-library/user-event": "^12.8.3",
"@types/react-dom": "^18.0.3",
"antd": "^4.15.0", "antd": "^4.15.0",
"chart.js": "^3.6.0", "chart.js": "^3.6.0",
"chartjs-adapter-moment": "^1.0.0", "chartjs-adapter-moment": "^1.0.0",
@ -3322,8 +3323,7 @@
"node_modules/@types/prop-types": { "node_modules/@types/prop-types": {
"version": "15.7.4", "version": "15.7.4",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz",
"integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==", "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ=="
"dev": true
}, },
"node_modules/@types/q": { "node_modules/@types/q": {
"version": "1.5.5", "version": "1.5.5",
@ -3334,13 +3334,20 @@
"version": "17.0.39", "version": "17.0.39",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.39.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.39.tgz",
"integrity": "sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug==", "integrity": "sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug==",
"dev": true,
"dependencies": { "dependencies": {
"@types/prop-types": "*", "@types/prop-types": "*",
"@types/scheduler": "*", "@types/scheduler": "*",
"csstype": "^3.0.2" "csstype": "^3.0.2"
} }
}, },
"node_modules/@types/react-dom": {
"version": "18.0.3",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.3.tgz",
"integrity": "sha512-1RRW9kst+67gveJRYPxGmVy8eVJ05O43hg77G2j5m76/RFJtMbcfAs2viQ2UNsvvDg8F7OfQZx8qQcl6ymygaQ==",
"dependencies": {
"@types/react": "*"
}
},
"node_modules/@types/react-router": { "node_modules/@types/react-router": {
"version": "5.1.18", "version": "5.1.18",
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz", "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz",
@ -3373,8 +3380,7 @@
"node_modules/@types/scheduler": { "node_modules/@types/scheduler": {
"version": "0.16.2", "version": "0.16.2",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
"integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew=="
"dev": true
}, },
"node_modules/@types/source-list-map": { "node_modules/@types/source-list-map": {
"version": "0.1.2", "version": "0.1.2",
@ -6608,8 +6614,7 @@
"node_modules/csstype": { "node_modules/csstype": {
"version": "3.0.10", "version": "3.0.10",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz",
"integrity": "sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA==", "integrity": "sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA=="
"dev": true
}, },
"node_modules/cyclist": { "node_modules/cyclist": {
"version": "1.0.1", "version": "1.0.1",
@ -24654,8 +24659,7 @@
"@types/prop-types": { "@types/prop-types": {
"version": "15.7.4", "version": "15.7.4",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz",
"integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ==", "integrity": "sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ=="
"dev": true
}, },
"@types/q": { "@types/q": {
"version": "1.5.5", "version": "1.5.5",
@ -24666,13 +24670,20 @@
"version": "17.0.39", "version": "17.0.39",
"resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.39.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-17.0.39.tgz",
"integrity": "sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug==", "integrity": "sha512-UVavlfAxDd/AgAacMa60Azl7ygyQNRwC/DsHZmKgNvPmRR5p70AJ5Q9EAmL2NWOJmeV+vVUI4IAP7GZrN8h8Ug==",
"dev": true,
"requires": { "requires": {
"@types/prop-types": "*", "@types/prop-types": "*",
"@types/scheduler": "*", "@types/scheduler": "*",
"csstype": "^3.0.2" "csstype": "^3.0.2"
} }
}, },
"@types/react-dom": {
"version": "18.0.3",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.3.tgz",
"integrity": "sha512-1RRW9kst+67gveJRYPxGmVy8eVJ05O43hg77G2j5m76/RFJtMbcfAs2viQ2UNsvvDg8F7OfQZx8qQcl6ymygaQ==",
"requires": {
"@types/react": "*"
}
},
"@types/react-router": { "@types/react-router": {
"version": "5.1.18", "version": "5.1.18",
"resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz", "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.18.tgz",
@ -24705,8 +24716,7 @@
"@types/scheduler": { "@types/scheduler": {
"version": "0.16.2", "version": "0.16.2",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
"integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew=="
"dev": true
}, },
"@types/source-list-map": { "@types/source-list-map": {
"version": "0.1.2", "version": "0.1.2",
@ -27245,8 +27255,7 @@
"csstype": { "csstype": {
"version": "3.0.10", "version": "3.0.10",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz",
"integrity": "sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA==", "integrity": "sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA=="
"dev": true
}, },
"cyclist": { "cyclist": {
"version": "1.0.1", "version": "1.0.1",

View File

@ -8,6 +8,7 @@
"@testing-library/jest-dom": "^5.11.10", "@testing-library/jest-dom": "^5.11.10",
"@testing-library/react": "^11.2.6", "@testing-library/react": "^11.2.6",
"@testing-library/user-event": "^12.8.3", "@testing-library/user-event": "^12.8.3",
"@types/react-dom": "^18.0.3",
"antd": "^4.15.0", "antd": "^4.15.0",
"chart.js": "^3.6.0", "chart.js": "^3.6.0",
"chartjs-adapter-moment": "^1.0.0", "chartjs-adapter-moment": "^1.0.0",

8
src/App.js → src/App.tsx Executable file → Normal file
View File

@ -3,22 +3,22 @@ import {
Switch, Switch,
Route Route
} from 'react-router-dom' } from 'react-router-dom'
import { memo } from 'react'
import { ConfigProvider } from 'antd' import { ConfigProvider } from 'antd'
import locale from 'antd/lib/locale/ru_RU' import locale from 'antd/lib/locale/ru_RU'
import { OpenAPI } from '@api'
import { getUserToken } from '@utils/storage'
import { PrivateRoute } from '@components/Private' import { PrivateRoute } from '@components/Private'
import { getUserToken } from '@utils/storage'
import { OpenAPI } from '@api'
import Main from '@pages/Main' import Main from '@pages/Main'
import Login from '@pages/Login' import Login from '@pages/Login'
import Register from '@pages/Register' import Register from '@pages/Register'
import '@styles/App.less' import '@styles/App.less'
import { memo } from 'react'
//OpenAPI.BASE = 'http://localhost:3000' //OpenAPI.BASE = 'http://localhost:3000'
OpenAPI.TOKEN = async () => getUserToken() OpenAPI.TOKEN = async () => getUserToken() ?? ''
OpenAPI.HEADERS = {'Content-Type': 'application/json'} OpenAPI.HEADERS = {'Content-Type': 'application/json'}
export const App = memo(() => ( export const App = memo(() => (

View File

@ -7,7 +7,7 @@ import { getUserId } from '@utils/storage'
import { isURLAvailable } from '@utils/permissions' import { isURLAvailable } from '@utils/permissions'
export type PrivateRouteProps = RouteProps & { export type PrivateRouteProps = RouteProps & {
root: string root?: string
path: string path: string
children?: ReactNode children?: ReactNode
redirect?: (location?: Location<unknown>) => ReactNode redirect?: (location?: Location<unknown>) => ReactNode

0
src/index.js → src/index.tsx Executable file → Normal file
View File

View File

@ -1,13 +0,0 @@
export const reportWebVitals = onPerfEntry => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry)
getFID(onPerfEntry)
getFCP(onPerfEntry)
getLCP(onPerfEntry)
getTTFB(onPerfEntry)
})
}
}
export default reportWebVitals

12
src/reportWebVitals.ts Normal file
View File

@ -0,0 +1,12 @@
import { getCLS, getFID, getFCP, getLCP, getTTFB, ReportHandler } from 'web-vitals'
export const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (!onPerfEntry) return
getCLS(onPerfEntry)
getFID(onPerfEntry)
getFCP(onPerfEntry)
getLCP(onPerfEntry)
getTTFB(onPerfEntry)
}
export default reportWebVitals