@tap-payments/auth-jsconnect 2.9.4-development → 2.9.5-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/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +1 -3
- package/build/app/store.d.ts +0 -2
- 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 -0
- package/build/constants/app.js +2 -0
- package/build/features/app/auth/authStore.js +17 -12
- package/build/features/app/connect/connectStore.js +13 -9
- package/build/features/app/connectExpress/connectExpressStore.js +18 -13
- package/build/features/app/individual/individualStore.js +1 -0
- package/build/features/app/signIn/signInStore.js +19 -15
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +0 -43
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/index.d.ts +2 -3
- package/build/index.js +2 -4
- package/build/utils/common.js +4 -4
- package/package.json +2 -2
- package/build/features/app/kyc/kycStore.d.ts +0 -121
- package/build/features/app/kyc/kycStore.js +0 -401
- package/build/features/kyc/KYC.d.ts +0 -10
- package/build/features/kyc/KYC.js +0 -99
- package/build/features/kyc/index.d.ts +0 -1
- package/build/features/kyc/index.js +0 -1
- package/build/features/kyc/screens/Loading/Loading.d.ts +0 -4
- package/build/features/kyc/screens/Loading/Loading.js +0 -10
- package/build/features/kyc/screens/Loading/index.d.ts +0 -2
- package/build/features/kyc/screens/Loading/index.js +0 -2
- package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +0 -5
- package/build/features/kyc/screens/OperatorError/OperatorError.js +0 -9
- package/build/features/kyc/screens/OperatorError/index.d.ts +0 -2
- package/build/features/kyc/screens/OperatorError/index.js +0 -2
- package/build/features/kyc/screens/Success/Success.d.ts +0 -5
- package/build/features/kyc/screens/Success/Success.js +0 -19
- package/build/features/kyc/screens/Success/index.d.ts +0 -2
- package/build/features/kyc/screens/Success/index.js +0 -2
- package/build/features/kyc/screens/Terms/Header.d.ts +0 -6
- package/build/features/kyc/screens/Terms/Header.js +0 -36
- package/build/features/kyc/screens/Terms/Terms.d.ts +0 -4
- package/build/features/kyc/screens/Terms/Terms.js +0 -72
- package/build/features/kyc/screens/Terms/index.d.ts +0 -2
- package/build/features/kyc/screens/Terms/index.js +0 -2
- package/build/features/kyc/screens/TokenError/TokenError.d.ts +0 -5
- package/build/features/kyc/screens/TokenError/TokenError.js +0 -9
- package/build/features/kyc/screens/TokenError/index.d.ts +0 -2
- package/build/features/kyc/screens/TokenError/index.js +0 -2
- package/build/features/kyc/screens/Users/Users.d.ts +0 -3
- package/build/features/kyc/screens/Users/Users.js +0 -76
- package/build/features/kyc/screens/Users/index.d.ts +0 -2
- package/build/features/kyc/screens/Users/index.js +0 -2
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +0 -45
- package/build/features/kyc/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/kyc/screens/VerifyNafath/index.js +0 -2
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +0 -5
- package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +0 -44
- package/build/features/kyc/screens/VerifyPaci/index.d.ts +0 -3
- package/build/features/kyc/screens/VerifyPaci/index.js +0 -2
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var OperatorError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('operator_is_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(OperatorError);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
-
import { useAppSelector } from '../../../../hooks';
|
|
6
|
-
import { kycSelector } from '../../../app/kyc/kycStore';
|
|
7
|
-
var Success = function (_a) {
|
|
8
|
-
var t = useTranslation().t;
|
|
9
|
-
var _b = useAppSelector(kycSelector), error = _b.error, loading = _b.loading, data = _b.data;
|
|
10
|
-
var redirectToBoard = function () {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
var baseUrl = window.location.origin;
|
|
13
|
-
var boardId = ((_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.verifyTokenData) === null || _b === void 0 ? void 0 : _b.boardId) || '';
|
|
14
|
-
var boardUrl = "".concat(baseUrl, "/board?board_id=").concat(boardId);
|
|
15
|
-
window.open(boardUrl, '_self');
|
|
16
|
-
};
|
|
17
|
-
return (_jsx(SuccessScreen, { title: t('kyc_success_title'), onSuccess: redirectToBoard, successTitle: t('kyc_success_button'), loading: loading, error: error || '' }));
|
|
18
|
-
};
|
|
19
|
-
export default React.memo(Success);
|
|
@@ -1,36 +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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { styled } from '@mui/material/styles';
|
|
15
|
-
import { useSanitizedTranslation } from '../../../../hooks';
|
|
16
|
-
import Text from '../../../../components/Text';
|
|
17
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
18
|
-
var ScreenContainerStyled = styled(ScreenContainer)(function () { return ({
|
|
19
|
-
alignItems: 'center',
|
|
20
|
-
justifyContent: 'center',
|
|
21
|
-
textAlign: 'center'
|
|
22
|
-
}); });
|
|
23
|
-
var TitleStyled = styled(Text)(function (_a) {
|
|
24
|
-
var theme = _a.theme;
|
|
25
|
-
return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightBold, color: theme.palette.info.dark, marginBlockEnd: theme.spacing(2), padding: theme.spacing(0, 2.5), lineHeight: '19.2px' }));
|
|
26
|
-
});
|
|
27
|
-
var DescriptionStyled = styled(Text)(function (_a) {
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return (__assign(__assign({}, theme.typography.body2), { fontWeight: theme.typography.fontWeightMedium, color: theme.palette.info.dark, marginBlockEnd: theme.spacing(2), padding: theme.spacing(0, 2.5), lineHeight: '16.8px' }));
|
|
30
|
-
});
|
|
31
|
-
var Header = function (_a) {
|
|
32
|
-
var idNumber = _a.idNumber;
|
|
33
|
-
var st = useSanitizedTranslation();
|
|
34
|
-
return (_jsxs(ScreenContainerStyled, { children: [_jsx(TitleStyled, { children: st('kyc_terms_title') }), _jsx(DescriptionStyled, { children: idNumber ? st('kyc_terms_description_single_user', { id_number: idNumber }) : st('kyc_terms_description') })] }));
|
|
35
|
-
};
|
|
36
|
-
export default React.memo(Header);
|
|
@@ -1,72 +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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import React, { memo } from 'react';
|
|
14
|
-
import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
15
|
-
import Box from '@mui/material/Box';
|
|
16
|
-
import { styled } from '@mui/material/styles';
|
|
17
|
-
import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
|
|
18
|
-
import { isSA, maskIDNumber } from '../../../../utils';
|
|
19
|
-
import { CONNECT_FLOWS } from '../../../../constants';
|
|
20
|
-
import Button from '../../../shared/Button';
|
|
21
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
22
|
-
import { createNafathAuth, createPaciAuth, kycSelector } from '../../../app/kyc/kycStore';
|
|
23
|
-
import Header from './Header';
|
|
24
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
25
|
-
var theme = _a.theme;
|
|
26
|
-
return ({
|
|
27
|
-
margin: theme.spacing(0, 2.5),
|
|
28
|
-
marginTop: theme.spacing(1.5),
|
|
29
|
-
boxShadow: theme.shadows[3],
|
|
30
|
-
backgroundColor: theme.palette.common.white,
|
|
31
|
-
fontWeight: theme.typography.fontWeightMedium,
|
|
32
|
-
fontSize: theme.spacing(1.875),
|
|
33
|
-
padding: theme.spacing(1.5),
|
|
34
|
-
borderRadius: theme.spacing(3.875),
|
|
35
|
-
textAlign: 'center'
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
export var Terms = function () {
|
|
39
|
-
var _a, _b, _c;
|
|
40
|
-
var st = useSanitizedTranslation();
|
|
41
|
-
var isAr = useLanguage().isAr;
|
|
42
|
-
var dispatch = useAppDispatch();
|
|
43
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
44
|
-
var _d = useAppSelector(kycSelector), loading = _d.loading, error = _d.error, data = _d.data;
|
|
45
|
-
var hasOneUserOnly = ((_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.userList) === null || _b === void 0 ? void 0 : _b.length) === 1;
|
|
46
|
-
var user = hasOneUserOnly ? (_c = data.responseData) === null || _c === void 0 ? void 0 : _c.userList[0] : undefined;
|
|
47
|
-
var idNumber = user ? maskIDNumber(user.identification.id) : '';
|
|
48
|
-
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
49
|
-
var onNext = function () {
|
|
50
|
-
if (hasOneUserOnly) {
|
|
51
|
-
if (isSACountry) {
|
|
52
|
-
dispatch(createNafathAuth(user))
|
|
53
|
-
.unwrap()
|
|
54
|
-
.then(function () {
|
|
55
|
-
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.verifyNafath));
|
|
56
|
-
})
|
|
57
|
-
.catch(function () { });
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
dispatch(createPaciAuth(user))
|
|
61
|
-
.unwrap()
|
|
62
|
-
.then(function () {
|
|
63
|
-
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.verifyPACI));
|
|
64
|
-
})
|
|
65
|
-
.catch(function () { });
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.users));
|
|
69
|
-
};
|
|
70
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, { children: st('kyc_terms_conditions') }), _jsx(BoxStyled, { children: st('kyc_refund_policy') }), _jsx(BoxStyled, __assign({ sx: { mb: error ? 3 : 0 } }, { children: st('kyc_dispute_policy') })), _jsx(Button, __assign({ sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: isSACountry ? st('approve_with_nafath_app') : st('approve_with_paci_app') }))] }));
|
|
71
|
-
};
|
|
72
|
-
export default memo(Terms);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import GenericError from '../../../shared/GenericError';
|
|
5
|
-
var TokenError = function (_a) {
|
|
6
|
-
var t = useTranslation().t;
|
|
7
|
-
return _jsx(GenericError, { error: t('kyc_token_invalid'), errorTitle: t('oops') });
|
|
8
|
-
};
|
|
9
|
-
export default React.memo(TokenError);
|
|
@@ -1,76 +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 React, { memo } from 'react';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { handleNextScreenStep, settingsSelector } from '../../../../app/settings';
|
|
17
|
-
import Text from '../../../../components/Text';
|
|
18
|
-
import Loader from '../../../../components/Loader';
|
|
19
|
-
import Warning from '../../../../components/Warning';
|
|
20
|
-
import { isSA, maskIDNumber } from '../../../../utils';
|
|
21
|
-
import { CONNECT_FLOWS, ICONS_NAMES } from '../../../../constants';
|
|
22
|
-
import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
|
|
23
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
24
|
-
import { clearError, createNafathAuth, createPaciAuth, kycSelector } from '../../../app/kyc/kycStore';
|
|
25
|
-
var BoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['loading'].includes(prop.toString()); } })(function (_a) {
|
|
26
|
-
var theme = _a.theme, loading = _a.loading;
|
|
27
|
-
return (__assign({ marginTop: theme.spacing(1), boxShadow: theme.shadows[3], backgroundColor: theme.palette.common.white, fontWeight: theme.typography.fontWeightMedium, fontSize: theme.spacing(1.875), padding: theme.spacing(1.5), borderRadius: theme.spacing(3.875), textAlign: 'center', cursor: 'pointer', display: 'flex', justifyContent: 'space-between' }, (loading && {
|
|
28
|
-
justifyContent: 'center'
|
|
29
|
-
})));
|
|
30
|
-
});
|
|
31
|
-
var DescriptionStyled = styled(Text)(function (_a) {
|
|
32
|
-
var theme = _a.theme;
|
|
33
|
-
return (__assign(__assign({}, theme.typography.body2), { fontWeight: theme.typography.fontWeightMedium, color: theme.palette.info.dark, marginBlockEnd: theme.spacing(2), padding: '0px 20px', lineHeight: '16.8px', textAlign: 'center' }));
|
|
34
|
-
});
|
|
35
|
-
var ImgStyled = styled('img')(function (_a) {
|
|
36
|
-
var theme = _a.theme;
|
|
37
|
-
return ({
|
|
38
|
-
filter: 'brightness(0)',
|
|
39
|
-
width: theme.spacing(2.25),
|
|
40
|
-
height: theme.spacing(2.25)
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
var Users = function () {
|
|
44
|
-
var _a;
|
|
45
|
-
var st = useSanitizedTranslation();
|
|
46
|
-
var dispatch = useAppDispatch();
|
|
47
|
-
var settingsData = useAppSelector(settingsSelector).data;
|
|
48
|
-
var _b = useAppSelector(kycSelector), loading = _b.loading, error = _b.error, data = _b.data;
|
|
49
|
-
var _c = React.useState(), activeUser = _c[0], setActiveUser = _c[1];
|
|
50
|
-
var userList = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.userList) || [];
|
|
51
|
-
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
52
|
-
var onClickUser = function (user) {
|
|
53
|
-
if (error)
|
|
54
|
-
dispatch(clearError());
|
|
55
|
-
setActiveUser(user);
|
|
56
|
-
if (isSACountry) {
|
|
57
|
-
dispatch(createNafathAuth(user))
|
|
58
|
-
.unwrap()
|
|
59
|
-
.then(function () {
|
|
60
|
-
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.verifyNafath));
|
|
61
|
-
})
|
|
62
|
-
.catch(function () { });
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
dispatch(createPaciAuth(user))
|
|
66
|
-
.unwrap()
|
|
67
|
-
.then(function () {
|
|
68
|
-
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.verifyPACI));
|
|
69
|
-
})
|
|
70
|
-
.catch(function () { });
|
|
71
|
-
};
|
|
72
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { pl: 2, pr: 2 } }, { children: [_jsx(DescriptionStyled, { children: st('kyc_users_description', { provider: isSACountry ? 'NAFATH' : 'PACI' }) }), userList.map(function (user, index) {
|
|
73
|
-
return (_jsx(BoxStyled, __assign({ onClick: function () { return onClickUser(user); } }, { children: (activeUser === null || activeUser === void 0 ? void 0 : activeUser.id) === user.id && loading ? (_jsx(Loader, { innerColor: 'black', outerColor: 'black', size: 8, style: { height: 20, width: 20 }, toggleAnimation: !!loading })) : (_jsxs(_Fragment, { children: [_jsx(ImgStyled, { src: ICONS_NAMES.individual_filled_icon }), maskIDNumber(user.identification.id), _jsx("span", {})] })) }), index));
|
|
74
|
-
}), error && (_jsx(Warning, __assign({ sx: { mt: 3, mb: 3 }, warningType: 'error' }, { children: error })))] })));
|
|
75
|
-
};
|
|
76
|
-
export default memo(Users);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { kycSelector, verifyNafath } from '../../../app/kyc/kycStore';
|
|
4
|
-
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
|
-
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
6
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
-
import { CONNECT_FLOWS } from '../../../../constants';
|
|
8
|
-
var VerifyNafathPage = function () {
|
|
9
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
10
|
-
var _b = React.useState(false), failed = _b[0], setFailed = _b[1];
|
|
11
|
-
var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
|
|
12
|
-
var dispatch = useAppDispatch();
|
|
13
|
-
var data = useAppSelector(kycSelector).data;
|
|
14
|
-
var _d = data.responseData || {}, createAuthData = _d.createAuthData, userList = _d.userList;
|
|
15
|
-
var _e = createAuthData || {}, expiry = _e.expiry, app_url_android = _e.app_url_android, app_url_ios = _e.app_url_ios, random = _e.random;
|
|
16
|
-
var hasOneUserOnly = (userList === null || userList === void 0 ? void 0 : userList.length) === 1;
|
|
17
|
-
React.useEffect(function () {
|
|
18
|
-
if (createAuthData && !isReady) {
|
|
19
|
-
setIsReady(true);
|
|
20
|
-
}
|
|
21
|
-
}, [createAuthData]);
|
|
22
|
-
React.useEffect(function () {
|
|
23
|
-
if (!isReady)
|
|
24
|
-
return;
|
|
25
|
-
var promise = dispatch(verifyNafath({ onSuccess: function () { return setSuccess(true); }, onFailure: function () { return setFailed(true); } }));
|
|
26
|
-
promise
|
|
27
|
-
.unwrap()
|
|
28
|
-
.then(function (_a) {
|
|
29
|
-
var nextScreen = _a.nextScreen;
|
|
30
|
-
if (nextScreen)
|
|
31
|
-
dispatch(handleNextScreenStep(nextScreen));
|
|
32
|
-
})
|
|
33
|
-
.catch(function () { });
|
|
34
|
-
return function () {
|
|
35
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
36
|
-
};
|
|
37
|
-
}, [isReady]);
|
|
38
|
-
var onBack = React.useCallback(function () {
|
|
39
|
-
dispatch(handlePrevScreenStep(hasOneUserOnly ? CONNECT_FLOWS.kyc.terms : CONNECT_FLOWS.kyc.users));
|
|
40
|
-
}, []);
|
|
41
|
-
if (!isReady)
|
|
42
|
-
return null;
|
|
43
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
44
|
-
};
|
|
45
|
-
export default React.memo(VerifyNafathPage);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
|
|
4
|
-
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
5
|
-
import { CONNECT_FLOWS } from '../../../../constants';
|
|
6
|
-
import { kycSelector, verifyPaci } from '../../../app/kyc/kycStore';
|
|
7
|
-
import PaciVerification from '../../../shared/PaciVerification';
|
|
8
|
-
var VerifyPaciPage = function () {
|
|
9
|
-
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
10
|
-
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
11
|
-
var dispatch = useAppDispatch();
|
|
12
|
-
var data = useAppSelector(kycSelector).data;
|
|
13
|
-
var _c = data.responseData || {}, createAuthData = _c.createAuthData, userList = _c.userList;
|
|
14
|
-
var _d = createAuthData || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
|
|
15
|
-
var hasOneUserOnly = (userList === null || userList === void 0 ? void 0 : userList.length) === 1;
|
|
16
|
-
React.useEffect(function () {
|
|
17
|
-
if (createAuthData && !isReady) {
|
|
18
|
-
setIsReady(true);
|
|
19
|
-
}
|
|
20
|
-
}, [createAuthData]);
|
|
21
|
-
React.useEffect(function () {
|
|
22
|
-
if (!isReady)
|
|
23
|
-
return;
|
|
24
|
-
var promise = dispatch(verifyPaci({ onSuccess: function () { return setSuccess(true); } }));
|
|
25
|
-
promise
|
|
26
|
-
.unwrap()
|
|
27
|
-
.then(function (_a) {
|
|
28
|
-
var nextScreen = _a.nextScreen;
|
|
29
|
-
if (nextScreen)
|
|
30
|
-
dispatch(handleNextScreenStep(nextScreen));
|
|
31
|
-
})
|
|
32
|
-
.catch(function () { });
|
|
33
|
-
return function () {
|
|
34
|
-
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
35
|
-
};
|
|
36
|
-
}, [isReady]);
|
|
37
|
-
var onBack = React.useCallback(function () {
|
|
38
|
-
dispatch(handlePrevScreenStep(hasOneUserOnly ? CONNECT_FLOWS.kyc.terms : CONNECT_FLOWS.kyc.users));
|
|
39
|
-
}, []);
|
|
40
|
-
if (!isReady)
|
|
41
|
-
return null;
|
|
42
|
-
return (_jsx(PaciVerification, { expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
43
|
-
};
|
|
44
|
-
export default React.memo(VerifyPaciPage);
|