@tap-payments/auth-jsconnect 2.8.74-development → 2.8.75-beta
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/build/@types/form.d.ts +1 -1
- package/build/api/auth.d.ts +0 -13
- package/build/api/index.d.ts +2 -2
- package/build/api/lead.d.ts +0 -6
- package/build/assets/locales/ar.json +1 -10
- package/build/assets/locales/en.json +1 -10
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -1
- package/build/constants/app.js +14 -35
- package/build/constants/assets.d.ts +0 -2
- package/build/constants/assets.js +0 -2
- package/build/features/app/auth/authStore.d.ts +15 -5
- package/build/features/app/auth/authStore.js +113 -58
- package/build/features/app/business/businessStore.d.ts +11 -16
- package/build/features/app/business/businessStore.js +44 -58
- package/build/features/app/connect/connectStore.d.ts +12 -19
- package/build/features/app/connect/connectStore.js +82 -151
- package/build/features/app/connectExpress/connectExpressStore.d.ts +33 -10
- package/build/features/app/connectExpress/connectExpressStore.js +251 -156
- package/build/features/app/individual/individualStore.js +2 -4
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
- package/build/features/auth/screens/NID/DOB.d.ts +6 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +10 -4
- package/build/features/auth/screens/NID/validation.d.ts +3 -0
- package/build/features/auth/screens/NID/validation.js +1 -0
- package/build/features/auth/screens/OTP/OTP.js +5 -1
- package/build/features/auth/screens/OTP/OTPInput.js +13 -2
- package/build/features/business/screens/OTP/OTP.d.ts +8 -0
- package/build/features/business/screens/OTP/OTP.js +90 -0
- package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPInput.js +49 -0
- package/build/features/business/screens/OTP/index.d.ts +3 -0
- package/build/features/business/screens/OTP/index.js +2 -0
- package/build/features/business/screens/OTP/validation.d.ts +8 -0
- package/build/features/business/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/NID/DOB.d.ts +5 -0
- package/build/features/connect/screens/NID/DOB.js +47 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +11 -5
- package/build/features/connect/screens/NID/validation.d.ts +3 -0
- package/build/features/connect/screens/NID/validation.js +1 -0
- package/build/features/connect/screens/OTP/OTPInput.js +11 -3
- package/build/features/{auth/screens/VerifyNafath/VerifyNafath.d.ts → connectExpress/screens/IdentityOTP/OTP.d.ts} +2 -2
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +88 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +56 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.js +2 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/DOB.js +47 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +9 -4
- package/build/features/connectExpress/screens/NID/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/NID/validation.js +2 -0
- package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -5
- package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -3
- package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
- package/build/features/featuresScreens.js +6 -21
- package/build/features/shared/Button/AbsherButton.d.ts +7 -0
- package/build/features/shared/Button/{NafathButton.js → AbsherButton.js} +3 -13
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/theme/palette.js +1 -2
- package/build/utils/common.js +4 -4
- package/package.json +2 -2
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/auth/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/auth/screens/VerifyNafath/index.js +0 -2
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/business/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/business/screens/VerifyNafath/index.js +0 -2
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connect/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connect/screens/VerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/VerifyNafath/index.js +0 -2
- package/build/features/shared/Button/NafathButton.d.ts +0 -7
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +0 -13
- package/build/features/shared/NafathVerification/NafathVerification.js +0 -92
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +0 -8
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +0 -53
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +0 -5
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +0 -8
- package/build/features/shared/NafathVerification/index.d.ts +0 -2
- package/build/features/shared/NafathVerification/index.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Button from './Button';
|
|
2
|
-
import
|
|
2
|
+
import AbsherButton from './AbsherButton';
|
|
3
3
|
import MobileButton from './MobileButton';
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
7
|
import ListButton from './IndividualActionButtons';
|
|
8
|
-
export {
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
9
9
|
export default Button;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Button from './Button';
|
|
2
|
-
import
|
|
2
|
+
import AbsherButton from './AbsherButton';
|
|
3
3
|
import MobileButton from './MobileButton';
|
|
4
4
|
import EmailProvidersButton from './EmailProvidersButtons';
|
|
5
5
|
import FlowsButtons from './FlowsButtons';
|
|
6
6
|
import SuccessButton from './SuccessButton';
|
|
7
7
|
import ListButton from './IndividualActionButtons';
|
|
8
|
-
export {
|
|
8
|
+
export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
|
|
9
9
|
export default Button;
|
package/build/theme/palette.js
CHANGED
package/build/utils/common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
|
|
3
3
|
export var sleep = function (milliseconds) {
|
|
4
4
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
5
5
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -13,10 +13,10 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
13
13
|
export var setBaseUrl = function (publicKey) {
|
|
14
14
|
var isProd = publicKey.includes('pk_live');
|
|
15
15
|
if (isProd) {
|
|
16
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
16
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
19
|
+
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
20
20
|
};
|
|
21
21
|
export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
22
22
|
var country = countryIso2.toLowerCase();
|
|
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
35
35
|
window.history.replaceState({}, '', newUrl);
|
|
36
36
|
};
|
|
37
37
|
export var openConnect = function (pk, countryCode) {
|
|
38
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
38
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
|
|
39
39
|
if (countryCode) {
|
|
40
40
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
41
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/auth-jsconnect",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.75-beta",
|
|
4
4
|
"description": "connect library, auth",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"copy:files": "copyfiles -u 1 src/**/*.css build/",
|
|
22
22
|
"tsc:alias": "tsc-alias -p tsconfig.json",
|
|
23
23
|
"ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
|
|
24
|
-
"push": "npm publish --access public --tag
|
|
24
|
+
"push": "npm publish --access public --tag beta"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": {
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { authSelector, verifyNafath as verifyNafathFun } from '../../../app/auth/authStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a;
|
|
9
|
-
var _b = React.useState(false), success = _b[0], setSuccess = _b[1];
|
|
10
|
-
var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
|
|
11
|
-
var dispatch = useAppDispatch();
|
|
12
|
-
var data = useAppSelector(authSelector).data;
|
|
13
|
-
var _d = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (data.responseData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [data.responseData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { businessSelector, verifyNafath } from '../../../app/business/businessStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(businessSelector).data;
|
|
12
|
-
var responseBody = data.nidData.responseBody;
|
|
13
|
-
var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (responseBody && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [responseBody]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafath({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectSelector, verifyNafath as verifyNafathFun } from '../../../app/connect/connectStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectSelector).data;
|
|
12
|
-
var responseBody = data.nidData.responseBody;
|
|
13
|
-
var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (responseBody && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [responseBody]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectExpressSelector, verifyNafathIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var IdentityVerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectExpressSelector).data;
|
|
12
|
-
var authData = (data.responseData || {}).authData;
|
|
13
|
-
var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (authData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [authData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathIdentityAsync({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(IdentityVerifyNafath);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectExpress/connectExpressStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
var VerifyNafath = function () {
|
|
8
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
10
|
-
var dispatch = useAppDispatch();
|
|
11
|
-
var data = useAppSelector(connectExpressSelector).data;
|
|
12
|
-
var authData = (data.responseData || {}).authData;
|
|
13
|
-
var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
|
|
14
|
-
React.useEffect(function () {
|
|
15
|
-
if (authData && !isReady) {
|
|
16
|
-
setIsReady(true);
|
|
17
|
-
}
|
|
18
|
-
}, [authData]);
|
|
19
|
-
React.useEffect(function () {
|
|
20
|
-
if (!isReady)
|
|
21
|
-
return;
|
|
22
|
-
var promise = dispatch(verifyNafathAsync({ onSuccess: function () { return setSuccess(true); } }));
|
|
23
|
-
return function () {
|
|
24
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
25
|
-
};
|
|
26
|
-
}, [isReady]);
|
|
27
|
-
var onBack = React.useCallback(function () {
|
|
28
|
-
dispatch(handlePrevScreenStep());
|
|
29
|
-
}, []);
|
|
30
|
-
if (!isReady)
|
|
31
|
-
return null;
|
|
32
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
33
|
-
};
|
|
34
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ButtonProps } from '../../../components/Button';
|
|
2
|
-
interface NafathButtonProps extends ButtonProps {
|
|
3
|
-
loading?: boolean;
|
|
4
|
-
hideIcon?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default function NafathButton({ children, hideIcon, disabled, ...props }: NafathButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface VerifyNafathProps {
|
|
3
|
-
randomNumber: string;
|
|
4
|
-
success: boolean;
|
|
5
|
-
expiryInSeconds: number;
|
|
6
|
-
urls?: {
|
|
7
|
-
android: string;
|
|
8
|
-
ios: string;
|
|
9
|
-
};
|
|
10
|
-
onFinish?: () => void;
|
|
11
|
-
}
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ randomNumber, success, expiryInSeconds, urls, onFinish }: VerifyNafathProps) => import("react/jsx-runtime").JSX.Element>;
|
|
13
|
-
export default _default;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import Box from '@mui/material/Box/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { useTranslation } from 'react-i18next';
|
|
17
|
-
import Text from '../../../components/Text';
|
|
18
|
-
import { ScreenContainer } from '../../shared/Containers';
|
|
19
|
-
import { MobileButton } from '../../shared/Button';
|
|
20
|
-
import { mobileOS } from '../../../utils';
|
|
21
|
-
import { useCountUp } from '../../../hooks';
|
|
22
|
-
import VerifyNafathLoading from './VerifyNafathLoading';
|
|
23
|
-
import VerifyNafathSuccess from './VerifyNafathSuccess';
|
|
24
|
-
var VerifyNafathTitleContainerStyled = styled(Box)(function (_a) {
|
|
25
|
-
var theme = _a.theme;
|
|
26
|
-
return ({
|
|
27
|
-
direction: theme.direction,
|
|
28
|
-
display: 'flex',
|
|
29
|
-
flexDirection: 'column',
|
|
30
|
-
alignItems: 'center',
|
|
31
|
-
marginBottom: theme.spacing(2.5)
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
var VerifyNafathTitleStyled = styled(Text)(function (_a) {
|
|
35
|
-
var theme = _a.theme;
|
|
36
|
-
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBottom: theme.spacing(2.4), lineHeight: '19.2px' }));
|
|
37
|
-
});
|
|
38
|
-
var VerifyNafathSubTitleStyled = styled(Text)(function (_a) {
|
|
39
|
-
var theme = _a.theme;
|
|
40
|
-
return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center', marginLeft: theme.spacing(3), marginRight: theme.spacing(3) }));
|
|
41
|
-
});
|
|
42
|
-
var Container = styled(Box)(function (_a) {
|
|
43
|
-
var theme = _a.theme;
|
|
44
|
-
return ({
|
|
45
|
-
position: 'relative',
|
|
46
|
-
display: 'flex',
|
|
47
|
-
justifyContent: 'center',
|
|
48
|
-
alignItems: 'center',
|
|
49
|
-
maxHeight: '300px',
|
|
50
|
-
marginBottom: theme.spacing(3.25)
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
var VerifyNafath = function (_a) {
|
|
54
|
-
var randomNumber = _a.randomNumber, success = _a.success, expiryInSeconds = _a.expiryInSeconds, urls = _a.urls, onFinish = _a.onFinish;
|
|
55
|
-
var t = useTranslation().t;
|
|
56
|
-
var count = useCountUp({ start: 0, end: expiryInSeconds, sleepMS: 1000 }).count;
|
|
57
|
-
var errorWaitingTime = 3;
|
|
58
|
-
var phases = 2;
|
|
59
|
-
var remainingTime = expiryInSeconds - errorWaitingTime;
|
|
60
|
-
var phaseNumber = Math.floor((count / remainingTime) * phases) + 1;
|
|
61
|
-
var isEnded = count === expiryInSeconds;
|
|
62
|
-
var endPhaseStarted = count >= remainingTime;
|
|
63
|
-
console.log('VerifyNafath', VerifyNafath);
|
|
64
|
-
React.useEffect(function () {
|
|
65
|
-
if (isEnded && onFinish)
|
|
66
|
-
onFinish();
|
|
67
|
-
}, [isEnded]);
|
|
68
|
-
var onRedirect = React.useCallback(function () {
|
|
69
|
-
if (os === 'Android') {
|
|
70
|
-
window.open(urls === null || urls === void 0 ? void 0 : urls.android, '_blank');
|
|
71
|
-
}
|
|
72
|
-
if (os === 'iOS') {
|
|
73
|
-
window.open(urls === null || urls === void 0 ? void 0 : urls.ios, '_blank');
|
|
74
|
-
}
|
|
75
|
-
}, [urls]);
|
|
76
|
-
var os = React.useMemo(function () { return mobileOS(); }, []);
|
|
77
|
-
var isAndroid = React.useMemo(function () { return os === 'Android' && (urls === null || urls === void 0 ? void 0 : urls.android); }, [os, urls]);
|
|
78
|
-
var isIOS = React.useMemo(function () { return os === 'iOS' && (urls === null || urls === void 0 ? void 0 : urls.ios); }, [os, urls]);
|
|
79
|
-
var title = React.useMemo(function () {
|
|
80
|
-
if (phaseNumber === 1)
|
|
81
|
-
return 'nafath_verification_title_wait';
|
|
82
|
-
return 'nafath_verification_title_check';
|
|
83
|
-
}, [phaseNumber]);
|
|
84
|
-
var description = React.useMemo(function () {
|
|
85
|
-
if (phaseNumber === 1)
|
|
86
|
-
return 'nafath_verification_description_wait';
|
|
87
|
-
return 'nafath_verification_description_check';
|
|
88
|
-
}, [phaseNumber]);
|
|
89
|
-
var isErrorPhase = endPhaseStarted && !success;
|
|
90
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyNafathTitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyNafathSuccess, {}) : _jsx(VerifyNafathLoading, { randomNumber: randomNumber, type: isErrorPhase ? 3 : phaseNumber }) }), isErrorPhase ? (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t('nafath_verification_title_error') }), _jsx(VerifyNafathSubTitleStyled, __assign({ sx: { pb: 1 } }, { children: t('nafath_verification_description_error') })), _jsx(VerifyNafathSubTitleStyled, { children: t('nafath_verification_redirection_message') })] })) : (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t(title) }), _jsx(VerifyNafathSubTitleStyled, { children: t(description) })] }))] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('open_nafath_app') })))] })));
|
|
91
|
-
};
|
|
92
|
-
export default React.memo(VerifyNafath);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
-
import LottieFile, { LottieAnimationFiles } from '../../../components/Lottie';
|
|
5
|
-
import Icon from '../../../components/Icon';
|
|
6
|
-
import { ICONS_NAMES } from '../../../constants';
|
|
7
|
-
import Text from '../../../components/Text';
|
|
8
|
-
import Box from '@mui/material/Box';
|
|
9
|
-
var IconStyled = styled(Icon)(function (_a) {
|
|
10
|
-
var theme = _a.theme;
|
|
11
|
-
return ({
|
|
12
|
-
position: 'absolute',
|
|
13
|
-
top: '50%',
|
|
14
|
-
left: '50%',
|
|
15
|
-
transform: 'translate(-50%, -50%)',
|
|
16
|
-
width: theme.spacing(10),
|
|
17
|
-
height: theme.spacing(10)
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
var NumberBoxStyled = styled(Box)(function (_a) {
|
|
21
|
-
var theme = _a.theme;
|
|
22
|
-
return ({
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
top: '92%',
|
|
25
|
-
left: '50%',
|
|
26
|
-
transform: 'translate(-59%, -59%)',
|
|
27
|
-
width: 59,
|
|
28
|
-
height: 59,
|
|
29
|
-
background: theme.palette.primary.contrastText,
|
|
30
|
-
display: 'flex',
|
|
31
|
-
justifyContent: 'center',
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
borderRadius: '100%'
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
var NumberStyled = styled(Text)(function (_a) {
|
|
37
|
-
var theme = _a.theme;
|
|
38
|
-
return ({
|
|
39
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
40
|
-
fontSize: '26.47px',
|
|
41
|
-
lineHeight: '31.77px'
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
var VerifyNafathLoading = function (_a) {
|
|
45
|
-
var _b = _a.loop, loop = _b === void 0 ? true : _b, type = _a.type, randomNumber = _a.randomNumber;
|
|
46
|
-
if (type === 1)
|
|
47
|
-
return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.NAFATH_VERIFY_ICON }), _jsx(NumberBoxStyled, { children: _jsx(NumberStyled, { children: randomNumber }) })] }));
|
|
48
|
-
if (type === 2)
|
|
49
|
-
return (_jsxs(_Fragment, { children: [_jsx(LottieFile, { file: LottieAnimationFiles.pulsating_circle_waves, loop: loop, width: '90%' }), _jsx(IconStyled, { src: ICONS_NAMES.NAFATH_VERIFY_ICON }), _jsx(NumberBoxStyled, { children: _jsx(NumberStyled, { children: randomNumber }) })] }));
|
|
50
|
-
return (_jsx(_Fragment, { children: _jsx(LottieFile, { file: LottieAnimationFiles.error, loop: false, width: '60%' }) }));
|
|
51
|
-
};
|
|
52
|
-
VerifyNafathLoading.defaultProps = {};
|
|
53
|
-
export default memo(VerifyNafathLoading);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { memo } from 'react';
|
|
3
|
-
import LottieFile, { LottieAnimationFiles } from '../../../components/Lottie';
|
|
4
|
-
var VerifyPACISuccess = function () {
|
|
5
|
-
return (_jsx(_Fragment, { children: _jsx(LottieFile, { loop: false, file: LottieAnimationFiles.success, width: '90%' }) }));
|
|
6
|
-
};
|
|
7
|
-
VerifyPACISuccess.defaultProps = {};
|
|
8
|
-
export default memo(VerifyPACISuccess);
|