@basiq/connect-auth 0.1.72 → 0.1.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/dist/60fda426a98e8c5b0470d694e2c66520.otf +1 -0
- package/dist/d4bd6e2e30a9c41422cecb85a045da71.otf +1 -0
- package/dist/main.js +1 -1
- package/package.json +98 -98
- package/.eslintrc.json +0 -48
- package/.prettierrc +0 -12
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/App.d.ts +0 -3
- package/src/App.js +0 -141
- package/src/App.test.d.ts +0 -1
- package/src/App.test.js +0 -13
- package/src/App.test.tsx +0 -9
- package/src/App.tsx +0 -80
- package/src/actions/actions.d.ts +0 -22
- package/src/actions/actions.js +0 -140
- package/src/actions/actions.ts +0 -71
- package/src/components/modals/LoadingModal.d.ts +0 -8
- package/src/components/modals/LoadingModal.js +0 -20
- package/src/components/modals/LoadingModal.tsx +0 -28
- package/src/components/modals/index.d.ts +0 -1
- package/src/components/modals/index.js +0 -8
- package/src/components/modals/index.ts +0 -1
- package/src/components/pages/AuthScreen.d.ts +0 -9
- package/src/components/pages/AuthScreen.js +0 -148
- package/src/components/pages/AuthScreen.tsx +0 -94
- package/src/components/pages/NotFound.d.ts +0 -6
- package/src/components/pages/NotFound.js +0 -27
- package/src/components/pages/NotFound.tsx +0 -44
- package/src/components/pages/Page.d.ts +0 -18
- package/src/components/pages/Page.js +0 -24
- package/src/components/pages/Page.tsx +0 -46
- package/src/components/pages/StartScreen.d.ts +0 -9
- package/src/components/pages/StartScreen.js +0 -127
- package/src/components/pages/StartScreen.tsx +0 -77
- package/src/components/pages/index.d.ts +0 -4
- package/src/components/pages/index.js +0 -14
- package/src/components/pages/index.ts +0 -4
- package/src/components/ui/Button.d.ts +0 -10
- package/src/components/ui/Button.js +0 -17
- package/src/components/ui/Button.tsx +0 -24
- package/src/components/ui/Modal.d.ts +0 -9
- package/src/components/ui/Modal.js +0 -17
- package/src/components/ui/Modal.tsx +0 -29
- package/src/components/ui/icon.d.ts +0 -7
- package/src/components/ui/icon.js +0 -13
- package/src/components/ui/icon.tsx +0 -18
- package/src/components/ui/index.d.ts +0 -1
- package/src/components/ui/index.js +0 -8
- package/src/components/ui/index.ts +0 -1
- package/src/fonts/Mark-W1G-Bold.otf +0 -0
- package/src/fonts/Mark-W1G-Book.otf +0 -0
- package/src/fonts.d.ts +0 -1
- package/src/helpers/constants.d.ts +0 -1
- package/src/helpers/constants.js +0 -5
- package/src/helpers/constants.ts +0 -3
- package/src/helpers/hookUtils.d.ts +0 -2
- package/src/helpers/hookUtils.js +0 -10
- package/src/helpers/hookUtils.ts +0 -8
- package/src/helpers/index.d.ts +0 -3
- package/src/helpers/index.js +0 -19
- package/src/helpers/index.ts +0 -3
- package/src/helpers/utils.d.ts +0 -3
- package/src/helpers/utils.js +0 -15
- package/src/helpers/utils.ts +0 -12
- package/src/images/back.svg +0 -8
- package/src/images/error.svg +0 -10
- package/src/images/loading_indicator.svg +0 -14
- package/src/index.d.ts +0 -6
- package/src/index.js +0 -23
- package/src/index.tsx +0 -19
- package/src/locales/en/translation.json +0 -28
- package/src/locales/i18n.d.ts +0 -35
- package/src/locales/i18n.js +0 -28
- package/src/locales/i18n.ts +0 -27
- package/src/logo.svg +0 -1
- package/src/react-app-env.d.ts +0 -1
- package/src/react-i18next.d.ts +0 -9
- package/src/reportWebVitals.d.ts +0 -3
- package/src/reportWebVitals.js +0 -38
- package/src/reportWebVitals.ts +0 -15
- package/src/setupTests.d.ts +0 -1
- package/src/setupTests.js +0 -7
- package/src/setupTests.ts +0 -5
- package/src/styled.d.ts +0 -6
- package/src/styledComponents/base.d.ts +0 -4
- package/src/styledComponents/base.js +0 -32
- package/src/styledComponents/base.ts +0 -73
- package/src/styledComponents/breakpoints.d.ts +0 -15
- package/src/styledComponents/breakpoints.js +0 -35
- package/src/styledComponents/breakpoints.ts +0 -32
- package/src/styledComponents/index.d.ts +0 -4
- package/src/styledComponents/index.js +0 -20
- package/src/styledComponents/index.ts +0 -4
- package/src/styledComponents/pages/auth.d.ts +0 -10
- package/src/styledComponents/pages/auth.js +0 -29
- package/src/styledComponents/pages/auth.ts +0 -49
- package/src/styledComponents/pages/basic.d.ts +0 -23
- package/src/styledComponents/pages/basic.js +0 -75
- package/src/styledComponents/pages/basic.ts +0 -126
- package/src/styledComponents/pages/index.d.ts +0 -4
- package/src/styledComponents/pages/index.js +0 -20
- package/src/styledComponents/pages/index.ts +0 -4
- package/src/styledComponents/pages/notFound.d.ts +0 -9
- package/src/styledComponents/pages/notFound.js +0 -37
- package/src/styledComponents/pages/notFound.ts +0 -70
- package/src/styledComponents/pages/start.d.ts +0 -1
- package/src/styledComponents/pages/start.js +0 -13
- package/src/styledComponents/pages/start.ts +0 -6
- package/src/styledComponents/styles.d.ts +0 -2
- package/src/styledComponents/styles.js +0 -14
- package/src/styledComponents/styles.ts +0 -25
- package/src/styledComponents/theme.d.ts +0 -45
- package/src/styledComponents/theme.js +0 -47
- package/src/styledComponents/theme.ts +0 -58
- package/src/styledComponents/ui/basic.d.ts +0 -10
- package/src/styledComponents/ui/basic.js +0 -71
- package/src/styledComponents/ui/basic.ts +0 -96
- package/src/styledComponents/ui/button.d.ts +0 -9
- package/src/styledComponents/ui/button.js +0 -65
- package/src/styledComponents/ui/button.ts +0 -112
- package/src/styledComponents/ui/index.d.ts +0 -3
- package/src/styledComponents/ui/index.js +0 -19
- package/src/styledComponents/ui/index.ts +0 -3
- package/src/styledComponents/ui/modals.d.ts +0 -7
- package/src/styledComponents/ui/modals.js +0 -26
- package/src/styledComponents/ui/modals.ts +0 -48
- package/webpack.config.js +0 -66
package/package.json
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
2
|
+
"name": "@basiq/connect-auth",
|
|
3
|
+
"version": "0.1.75",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
6
|
+
"@testing-library/react": "^13.2.0",
|
|
7
|
+
"@testing-library/user-event": "^13.5.0",
|
|
8
|
+
"@types/jest": "^27.5.0",
|
|
9
|
+
"@types/node": "^16.11.33",
|
|
10
|
+
"@types/react": "^18.0.9",
|
|
11
|
+
"@types/react-dom": "^18.0.3",
|
|
12
|
+
"@types/styled-components": "^5.1.25",
|
|
13
|
+
"i18next": "^21.8.1",
|
|
14
|
+
"react": "^18.1.0",
|
|
15
|
+
"react-dom": "^18.1.0",
|
|
16
|
+
"react-i18next": "^11.16.9",
|
|
17
|
+
"react-router-dom": "^6.3.0",
|
|
18
|
+
"react-scripts": "5.0.1",
|
|
19
|
+
"styled-components": "^5.3.5",
|
|
20
|
+
"ts-loader": "^9.3.0",
|
|
21
|
+
"typescript": "^4.6.4",
|
|
22
|
+
"web-vitals": "^2.1.4"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^18.1.0",
|
|
26
|
+
"react-dom": "^18.1.0"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"start": "react-scripts start",
|
|
30
|
+
"build": "webpack --mode production",
|
|
31
|
+
"test": "react-scripts test",
|
|
32
|
+
"eject": "react-scripts eject",
|
|
33
|
+
"lint": "eslint .",
|
|
34
|
+
"lint:fix": "eslint --fix",
|
|
35
|
+
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,scss,json}' --config ./.prettierrc"
|
|
36
|
+
},
|
|
37
|
+
"browserslist": {
|
|
38
|
+
"production": [
|
|
39
|
+
">0.2%",
|
|
40
|
+
"not dead",
|
|
41
|
+
"not op_mini all"
|
|
42
|
+
],
|
|
43
|
+
"development": [
|
|
44
|
+
"last 1 chrome version",
|
|
45
|
+
"last 1 firefox version",
|
|
46
|
+
"last 1 safari version"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"resolutions": {
|
|
50
|
+
"styled-components": "^5"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@babel/cli": "^7.17.10",
|
|
54
|
+
"@babel/core": "^7.18.2",
|
|
55
|
+
"@babel/preset-env": "^7.18.2",
|
|
56
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
|
58
|
+
"@typescript-eslint/parser": "^5.26.0",
|
|
59
|
+
"babel-plugin-styled-components": "^2.0.7",
|
|
60
|
+
"eslint": "^8.16.0",
|
|
61
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
62
|
+
"eslint-config-prettier": "^8.5.0",
|
|
63
|
+
"eslint-import-resolver-typescript": "^2.7.1",
|
|
64
|
+
"eslint-plugin-import": "^2.26.0",
|
|
65
|
+
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
66
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
67
|
+
"eslint-plugin-react": "^7.30.0",
|
|
68
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
69
|
+
"prettier": "^2.6.2",
|
|
70
|
+
"url-loader": "^4.1.1",
|
|
71
|
+
"webpack-cli": "^4.9.2"
|
|
72
|
+
},
|
|
73
|
+
"babel": {
|
|
74
|
+
"presets": [
|
|
75
|
+
"@babel/preset-typescript"
|
|
76
|
+
],
|
|
77
|
+
"plugins": [
|
|
78
|
+
"babel-plugin-styled-components"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"description": "Basiq sms auth for redirection to basiq consent ui",
|
|
82
|
+
"main": "dist/main.js",
|
|
83
|
+
"repository": {
|
|
84
|
+
"type": "git",
|
|
85
|
+
"url": "git+https://github.com/basiqio/connect-code-validaiton.git"
|
|
86
|
+
},
|
|
87
|
+
"keywords": [
|
|
88
|
+
"sms",
|
|
89
|
+
"code",
|
|
90
|
+
"validation",
|
|
91
|
+
"basiq",
|
|
92
|
+
"connect"
|
|
93
|
+
],
|
|
94
|
+
"author": "Basiq",
|
|
95
|
+
"license": "ISC",
|
|
96
|
+
"bugs": {
|
|
97
|
+
"url": "https://github.com/basiqio/connect-code-validaiton/issues"
|
|
98
|
+
},
|
|
99
|
+
"homepage": "https://github.com/basiqio/connect-code-validaiton#readme"
|
|
100
100
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"plugin:react/recommended",
|
|
8
|
-
"airbnb",
|
|
9
|
-
"eslint:recommended",
|
|
10
|
-
"plugin:@typescript-eslint/recommended",
|
|
11
|
-
"prettier" // Add this line!
|
|
12
|
-
],
|
|
13
|
-
"parser": "@typescript-eslint/parser",
|
|
14
|
-
"parserOptions": {
|
|
15
|
-
"ecmaFeatures": {
|
|
16
|
-
"jsx": true
|
|
17
|
-
},
|
|
18
|
-
"ecmaVersion": "latest",
|
|
19
|
-
"sourceType": "module"
|
|
20
|
-
},
|
|
21
|
-
"plugins": ["react", "react-hooks", "@typescript-eslint", "prettier"],
|
|
22
|
-
"rules": {
|
|
23
|
-
"no-use-before-define": "off",
|
|
24
|
-
"react/require-default-props": "off",
|
|
25
|
-
"react/jsx-no-useless-fragment": "off",
|
|
26
|
-
"react/no-array-index-key": "off",
|
|
27
|
-
"no-unused-vars": "warn",
|
|
28
|
-
"no-nested-ternary": "off",
|
|
29
|
-
"import/prefer-default-export": "off",
|
|
30
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
31
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
32
|
-
"@typescript-eslint/no-use-before-define": ["error"],
|
|
33
|
-
"react/jsx-filename-extension": ["warn", { "extensions": [".ts", ".tsx"] }],
|
|
34
|
-
"import/extensions": [
|
|
35
|
-
"error",
|
|
36
|
-
"ignorePackages",
|
|
37
|
-
{
|
|
38
|
-
"ts": "never",
|
|
39
|
-
"tsx": "never"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
"settings": {
|
|
44
|
-
"import/resolver": {
|
|
45
|
-
"typescript": {}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
package/.prettierrc
DELETED
package/public/favicon.ico
DELETED
|
Binary file
|
package/public/index.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8" />
|
|
5
|
-
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
-
<meta name="theme-color" content="#000000" />
|
|
8
|
-
<meta
|
|
9
|
-
name="description"
|
|
10
|
-
content="Web site created using create-react-app"
|
|
11
|
-
/>
|
|
12
|
-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
|
13
|
-
<!--
|
|
14
|
-
manifest.json provides metadata used when your web app is installed on a
|
|
15
|
-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
|
16
|
-
-->
|
|
17
|
-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
|
18
|
-
<!--
|
|
19
|
-
Notice the use of %PUBLIC_URL% in the tags above.
|
|
20
|
-
It will be replaced with the URL of the `public` folder during the build.
|
|
21
|
-
Only files inside the `public` folder can be referenced from the HTML.
|
|
22
|
-
|
|
23
|
-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
|
24
|
-
work correctly both with client-side routing and a non-root public URL.
|
|
25
|
-
Learn how to configure a non-root public URL by running `npm run build`.
|
|
26
|
-
-->
|
|
27
|
-
<title>Basiq Connect</title>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
31
|
-
<div id="root"></div>
|
|
32
|
-
<!--
|
|
33
|
-
This HTML file is a template.
|
|
34
|
-
If you open it directly in the browser, you will see an empty page.
|
|
35
|
-
|
|
36
|
-
You can add webfonts, meta tags, or analytics to this file.
|
|
37
|
-
The build step will place the bundled scripts into the <body> tag.
|
|
38
|
-
|
|
39
|
-
To begin the development, run `npm start` or `yarn start`.
|
|
40
|
-
To create a production bundle, use `npm run build` or `yarn build`.
|
|
41
|
-
-->
|
|
42
|
-
</body>
|
|
43
|
-
</html>
|
package/public/logo192.png
DELETED
|
Binary file
|
package/public/logo512.png
DELETED
|
Binary file
|
package/public/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
package/public/robots.txt
DELETED
package/src/App.d.ts
DELETED
package/src/App.js
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
-
};
|
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
var react_1 = __importStar(require("react"));
|
|
66
|
-
var styledComponents_1 = require("./styledComponents");
|
|
67
|
-
var styles_1 = __importDefault(require("./styledComponents/styles"));
|
|
68
|
-
var helpers_1 = require("./helpers");
|
|
69
|
-
var pages_1 = require("./components/pages");
|
|
70
|
-
var actions_1 = require("./actions/actions");
|
|
71
|
-
var modals_1 = require("./components/modals");
|
|
72
|
-
function App() {
|
|
73
|
-
var _this = this;
|
|
74
|
-
var ref = (0, react_1.createRef)();
|
|
75
|
-
var _a = (0, react_1.useState)(false), shadow = _a[0], setShadow = _a[1];
|
|
76
|
-
var _b = (0, react_1.useState)(1), currentScreen = _b[0], setCurrentScreen = _b[1];
|
|
77
|
-
var _c = (0, react_1.useState)(false), loading = _c[0], setLoading = _c[1];
|
|
78
|
-
var _d = (0, react_1.useState)(null), authId = _d[0], setAuthId = _d[1];
|
|
79
|
-
var _e = (0, react_1.useState)(''), mobile = _e[0], setMobile = _e[1];
|
|
80
|
-
var _f = (0, react_1.useState)(''), logo = _f[0], setLogo = _f[1];
|
|
81
|
-
var _g = (0, react_1.useState)(''), appName = _g[0], setAppName = _g[1];
|
|
82
|
-
var _h = (0, react_1.useState)(''), errorCode = _h[0], setErrorCode = _h[1];
|
|
83
|
-
var handleConnectionsScroll = function (event) {
|
|
84
|
-
setShadow((0, helpers_1.detectScrollToBottom)(event));
|
|
85
|
-
};
|
|
86
|
-
(0, react_1.useEffect)(function () {
|
|
87
|
-
var id = window.location.pathname.substring(1);
|
|
88
|
-
var getData = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
89
|
-
var response;
|
|
90
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
91
|
-
return __generator(this, function (_j) {
|
|
92
|
-
switch (_j.label) {
|
|
93
|
-
case 0:
|
|
94
|
-
if (!(id.length > 0)) return [3 /*break*/, 2];
|
|
95
|
-
setAuthId(id);
|
|
96
|
-
setLoading(true);
|
|
97
|
-
return [4 /*yield*/, (0, actions_1.authUser)(id, 'GET')];
|
|
98
|
-
case 1:
|
|
99
|
-
response = _j.sent();
|
|
100
|
-
if (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.status) === 'code-not-sent') {
|
|
101
|
-
setMobile((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.mobile);
|
|
102
|
-
if ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.appName) {
|
|
103
|
-
setAppName((_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.appName);
|
|
104
|
-
}
|
|
105
|
-
if ((_f = (_e = response === null || response === void 0 ? void 0 : response.data) === null || _e === void 0 ? void 0 : _e.partner) === null || _f === void 0 ? void 0 : _f.logoUrl) {
|
|
106
|
-
setLogo((_h = (_g = response === null || response === void 0 ? void 0 : response.data) === null || _g === void 0 ? void 0 : _g.partner) === null || _h === void 0 ? void 0 : _h.logoUrl);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
setErrorCode(response === null || response === void 0 ? void 0 : response.statusCode.toString());
|
|
111
|
-
setCurrentScreen(3);
|
|
112
|
-
}
|
|
113
|
-
setLoading(false);
|
|
114
|
-
_j.label = 2;
|
|
115
|
-
case 2: return [2 /*return*/];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}); };
|
|
119
|
-
getData();
|
|
120
|
-
}, []);
|
|
121
|
-
var getScreen = function () {
|
|
122
|
-
switch (currentScreen) {
|
|
123
|
-
case 0:
|
|
124
|
-
return react_1.default.createElement(modals_1.LoadingModal, { isOpen: loading, disableTransparency: true });
|
|
125
|
-
case 1:
|
|
126
|
-
return react_1.default.createElement(pages_1.StartScreen, { appName: appName, shadow: shadow, onContinue: function () { return setCurrentScreen(2); }, authId: authId });
|
|
127
|
-
case 2:
|
|
128
|
-
return react_1.default.createElement(pages_1.AuthScreen, { number: mobile, onBack: function () { return setCurrentScreen(1); }, shadow: shadow, authId: authId });
|
|
129
|
-
default:
|
|
130
|
-
return react_1.default.createElement(pages_1.NotFound, { messageCode: errorCode });
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
return (react_1.default.createElement(styledComponents_1.Root, null,
|
|
134
|
-
react_1.default.createElement(styles_1.default, null),
|
|
135
|
-
react_1.default.createElement(styledComponents_1.AppContainerWrapper, null,
|
|
136
|
-
react_1.default.createElement(styledComponents_1.AppContainer, { onScroll: handleConnectionsScroll, ref: ref },
|
|
137
|
-
logo && (react_1.default.createElement(styledComponents_1.PageHeader, null,
|
|
138
|
-
react_1.default.createElement("img", { src: logo, alt: "logo" }))),
|
|
139
|
-
react_1.default.createElement(styledComponents_1.AppContainerPage, null, getScreen())))));
|
|
140
|
-
}
|
|
141
|
-
exports.default = App;
|
package/src/App.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/App.test.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var react_1 = __importDefault(require("react"));
|
|
7
|
-
var react_2 = require("@testing-library/react");
|
|
8
|
-
var App_1 = __importDefault(require("./App"));
|
|
9
|
-
test('renders learn react link', function () {
|
|
10
|
-
(0, react_2.render)(react_1.default.createElement(App_1.default, null));
|
|
11
|
-
var linkElement = react_2.screen.getByText(/learn react/i);
|
|
12
|
-
expect(linkElement).toBeInTheDocument();
|
|
13
|
-
});
|
package/src/App.test.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import App from './App';
|
|
4
|
-
|
|
5
|
-
test('renders learn react link', () => {
|
|
6
|
-
render(<App />);
|
|
7
|
-
const linkElement = screen.getByText(/learn react/i);
|
|
8
|
-
expect(linkElement).toBeInTheDocument();
|
|
9
|
-
});
|
package/src/App.tsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React, { createRef, SyntheticEvent, useEffect, useState } from 'react';
|
|
2
|
-
import { AppContainer, AppContainerPage, AppContainerWrapper, PageHeader, Root } from './styledComponents';
|
|
3
|
-
import GlobalStyles from './styledComponents/styles';
|
|
4
|
-
import { detectScrollToBottom } from './helpers';
|
|
5
|
-
import { AuthScreen, NotFound, StartScreen } from './components/pages';
|
|
6
|
-
import { authUser } from './actions/actions';
|
|
7
|
-
import { LoadingModal } from './components/modals';
|
|
8
|
-
|
|
9
|
-
function App() {
|
|
10
|
-
const ref = createRef<HTMLDivElement>();
|
|
11
|
-
|
|
12
|
-
const [shadow, setShadow] = useState(false);
|
|
13
|
-
const [currentScreen, setCurrentScreen] = useState(1);
|
|
14
|
-
const [loading, setLoading] = useState(false);
|
|
15
|
-
const [authId, setAuthId] = useState(null as string | null);
|
|
16
|
-
const [mobile, setMobile] = useState('');
|
|
17
|
-
const [logo, setLogo] = useState('');
|
|
18
|
-
const [appName, setAppName] = useState('');
|
|
19
|
-
const [errorCode, setErrorCode] = useState('');
|
|
20
|
-
|
|
21
|
-
const handleConnectionsScroll = (event: SyntheticEvent<HTMLDivElement>) => {
|
|
22
|
-
setShadow(detectScrollToBottom(event));
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
const id = window.location.pathname.substring(1);
|
|
27
|
-
const getData = async () => {
|
|
28
|
-
if (id.length > 0) {
|
|
29
|
-
setAuthId(id);
|
|
30
|
-
setLoading(true);
|
|
31
|
-
const response = await authUser(id, 'GET');
|
|
32
|
-
if (response?.data?.status === 'code-not-sent') {
|
|
33
|
-
setMobile(response?.data?.mobile);
|
|
34
|
-
if(response?.data?.appName){
|
|
35
|
-
setAppName(response?.data?.appName);
|
|
36
|
-
}
|
|
37
|
-
if(response?.data?.partner?.logoUrl){
|
|
38
|
-
setLogo(response?.data?.partner?.logoUrl);
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
setErrorCode(response?.statusCode.toString());
|
|
42
|
-
setCurrentScreen(3);
|
|
43
|
-
}
|
|
44
|
-
setLoading(false);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
getData();
|
|
48
|
-
}, []);
|
|
49
|
-
|
|
50
|
-
const getScreen = () => {
|
|
51
|
-
switch (currentScreen) {
|
|
52
|
-
case 0:
|
|
53
|
-
return <LoadingModal isOpen={loading} disableTransparency />;
|
|
54
|
-
case 1:
|
|
55
|
-
return <StartScreen appName={appName} shadow={shadow} onContinue={() => setCurrentScreen(2)} authId={authId} />;
|
|
56
|
-
case 2:
|
|
57
|
-
return <AuthScreen number={mobile} onBack={() => setCurrentScreen(1)} shadow={shadow} authId={authId} />;
|
|
58
|
-
default:
|
|
59
|
-
return <NotFound messageCode={errorCode} />;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<Root>
|
|
65
|
-
<GlobalStyles />
|
|
66
|
-
<AppContainerWrapper>
|
|
67
|
-
<AppContainer onScroll={handleConnectionsScroll} ref={ref}>
|
|
68
|
-
{logo && (
|
|
69
|
-
<PageHeader>
|
|
70
|
-
<img src={logo} alt="logo" />
|
|
71
|
-
</PageHeader>
|
|
72
|
-
)}
|
|
73
|
-
<AppContainerPage>{getScreen()}</AppContainerPage>
|
|
74
|
-
</AppContainer>
|
|
75
|
-
</AppContainerWrapper>
|
|
76
|
-
</Root>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default App;
|
package/src/actions/actions.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const verifySmsCode: (authRequestId: string, smsCode: string) => Promise<{
|
|
2
|
-
data: any;
|
|
3
|
-
headers: Headers;
|
|
4
|
-
statusCode: number;
|
|
5
|
-
error?: undefined;
|
|
6
|
-
} | {
|
|
7
|
-
headers: Headers;
|
|
8
|
-
statusCode: number;
|
|
9
|
-
error: string;
|
|
10
|
-
data?: undefined;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const authUser: (authRequestId: string, method?: 'POST' | 'GET') => Promise<{
|
|
13
|
-
data: any;
|
|
14
|
-
headers: Headers;
|
|
15
|
-
statusCode: number;
|
|
16
|
-
error?: undefined;
|
|
17
|
-
} | {
|
|
18
|
-
headers: Headers;
|
|
19
|
-
statusCode: number;
|
|
20
|
-
error: string;
|
|
21
|
-
data?: undefined;
|
|
22
|
-
}>;
|