@tap-payments/auth-jsconnect 1.0.91-test → 1.0.95-test
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/README.md +58 -52
- package/build/@types/app.d.ts +11 -2
- package/build/@types/app.js +9 -0
- package/build/@types/form.d.ts +2 -0
- package/build/api/auth.d.ts +22 -3
- package/build/api/axios.d.ts +2 -0
- package/build/api/axios.js +64 -0
- package/build/api/country.d.ts +1 -2
- package/build/api/country.js +7 -8
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +5 -2
- package/build/api/index.d.ts +7 -8
- package/build/api/ip.d.ts +1 -1
- package/build/api/ip.js +5 -2
- package/build/api/lead.d.ts +2 -0
- package/build/api/operator.d.ts +1 -1
- package/build/api/operator.js +60 -4
- package/build/app/rootReducer.d.ts +0 -1
- package/build/app/rootReducer.js +1 -3
- package/build/app/settings.d.ts +9 -12
- package/build/app/settings.js +87 -111
- package/build/app/store.d.ts +0 -2
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +2 -2
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +16 -4
- package/build/components/AnimationFlow/Loader.js +1 -1
- package/build/constants/app.d.ts +6 -1
- package/build/constants/app.js +16 -12
- package/build/features/app/bank/bankStore.d.ts +5 -1
- package/build/features/app/bank/bankStore.js +41 -4
- package/build/features/app/business/businessStore.d.ts +5 -7
- package/build/features/app/business/businessStore.js +44 -46
- package/build/features/app/connect/connectStore.d.ts +2 -7
- package/build/features/app/connect/connectStore.js +23 -55
- package/build/features/app/individual/individualStore.d.ts +6 -7
- package/build/features/app/individual/individualStore.js +55 -50
- package/build/features/app/password/passwordStore.d.ts +34 -2
- package/build/features/app/password/passwordStore.js +218 -8
- package/build/features/app/tax/taxStore.d.ts +5 -1
- package/build/features/app/tax/taxStore.js +43 -6
- package/build/features/bank/Bank.js +8 -7
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -1
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +2 -1
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
- package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/bank/screens/Verify/OTPInput.js +6 -1
- package/build/features/bank/screens/Verify/Verify.js +3 -2
- package/build/features/business/Business.js +9 -11
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -5
- package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/business/screens/Verify/OTPInput.js +6 -1
- package/build/features/business/screens/Verify/Verify.js +3 -2
- package/build/features/connect/Connect.js +7 -9
- package/build/features/connect/screens/Merchant/BrandName.js +3 -2
- package/build/features/connect/screens/Mobile/Mobile.js +1 -1
- package/build/features/featuresScreens.d.ts +0 -1
- package/build/features/featuresScreens.js +5 -7
- package/build/features/individual/Individual.js +9 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +4 -2
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
- package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/individual/screens/Verify/OTPInput.js +6 -1
- package/build/features/individual/screens/Verify/Verify.js +3 -2
- package/build/features/password/Password.js +16 -9
- package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
- package/build/features/password/screens/OTP/OTP.d.ts +8 -0
- package/build/features/password/screens/OTP/OTP.js +78 -0
- package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/password/screens/OTP/OTPInput.js +46 -0
- package/build/features/password/screens/OTP/index.d.ts +3 -0
- package/build/features/password/screens/OTP/index.js +2 -0
- package/build/features/password/screens/OTP/validation.d.ts +8 -0
- package/build/features/password/screens/OTP/validation.js +4 -0
- package/build/features/password/screens/Success/Success.js +8 -2
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -5
- package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/password/screens/Verify/OTPInput.js +6 -1
- package/build/features/password/screens/Verify/Verify.js +3 -2
- package/build/features/shared/Background/Background.js +3 -2
- package/build/features/shared/Background/LogoBackground.d.ts +1 -4
- package/build/features/shared/Background/LogoBackground.js +4 -32
- package/build/features/shared/Button/AbsherButton.js +3 -8
- package/build/features/shared/Button/EmailProvidersButtons.js +2 -1
- package/build/features/shared/Button/FlowsButtons.d.ts +10 -1
- package/build/features/shared/Button/FlowsButtons.js +100 -7
- package/build/features/shared/Button/MobileButton.js +3 -8
- package/build/features/shared/Button/SuccessButton.js +17 -13
- package/build/features/shared/Footer/Footer.js +2 -3
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +10 -2
- package/build/features/tax/Tax.js +7 -6
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -4
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +5 -2
- package/build/features/tax/screens/TaxDetails/VATId.js +13 -2
- package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/validation.js +2 -1
- package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/tax/screens/Verify/OTPInput.js +6 -1
- package/build/features/tax/screens/Verify/Verify.js +3 -2
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +1 -4
- package/build/hooks/useAppConfig.js +13 -110
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/hooks/useAppTheme.js +3 -2
- package/build/hooks/useErrorListener.d.ts +1 -1
- package/build/hooks/useErrorListener.js +4 -6
- package/build/hooks/useStepStartedListener.d.ts +1 -0
- package/build/hooks/useStepStartedListener.js +10 -0
- package/build/index.d.ts +2 -3
- package/build/index.js +2 -5
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +1 -2
- package/build/utils/array.d.ts +3 -0
- package/build/utils/array.js +10 -0
- package/build/utils/string.d.ts +2 -0
- package/build/utils/string.js +23 -0
- package/package.json +127 -127
- package/build/features/Landing/Landing.d.ts +0 -7
- package/build/features/Landing/Landing.js +0 -55
- package/build/features/Landing/index.d.ts +0 -1
- package/build/features/Landing/index.js +0 -1
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
- package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
- package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
- package/build/features/app/landing/landingStore.d.ts +0 -22
- package/build/features/app/landing/landingStore.js +0 -103
|
@@ -33,15 +33,10 @@ var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop
|
|
|
33
33
|
})));
|
|
34
34
|
});
|
|
35
35
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
36
|
-
var _b;
|
|
37
36
|
var theme = _a.theme;
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_b[theme.breakpoints.down('sm')] = {
|
|
42
|
-
margin: theme.spacing(0, 2.5, 0.25, 2.5)
|
|
43
|
-
},
|
|
44
|
-
_b);
|
|
37
|
+
return ({
|
|
38
|
+
margin: theme.spacing(0, 2.5, 2.5, 2.5)
|
|
39
|
+
});
|
|
45
40
|
});
|
|
46
41
|
export default function MobileButton(_a) {
|
|
47
42
|
var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
|
|
@@ -25,25 +25,29 @@ import React from 'react';
|
|
|
25
25
|
import Button from './Button';
|
|
26
26
|
import { styled } from '@mui/material/styles';
|
|
27
27
|
import Box from '@mui/material/Box';
|
|
28
|
-
var ButtonStyled = styled(Button
|
|
29
|
-
|
|
30
|
-
})(function (_a) {
|
|
31
|
-
var theme = _a.theme, isLoading = _a.isLoading;
|
|
28
|
+
var ButtonStyled = styled(Button)(function (_a) {
|
|
29
|
+
var theme = _a.theme;
|
|
32
30
|
return ({
|
|
33
|
-
'&.MuiButton-outlined':
|
|
31
|
+
'&.MuiButton-outlined': {
|
|
32
|
+
width: '100%',
|
|
33
|
+
textTransform: 'none',
|
|
34
|
+
paddingInlineStart: theme.spacing(0.75),
|
|
35
|
+
backgroundColor: theme.palette.common.white,
|
|
36
|
+
color: theme.palette.primary.main,
|
|
37
|
+
border: "1px solid ".concat(theme.palette.primary.main),
|
|
38
|
+
'&:hover': {
|
|
34
39
|
backgroundColor: theme.palette.common.white,
|
|
35
40
|
color: theme.palette.primary.main
|
|
36
|
-
},
|
|
41
|
+
},
|
|
42
|
+
'&:disabled': {
|
|
37
43
|
backgroundColor: theme.palette.primary.main,
|
|
38
44
|
color: theme.palette.common.white
|
|
39
|
-
},
|
|
45
|
+
},
|
|
46
|
+
transition: theme.transitions.create(['width', 'padding'], {
|
|
40
47
|
easing: theme.transitions.easing.easeInOut,
|
|
41
48
|
duration: theme.transitions.duration.complex * 2
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
width: theme.spacing(6),
|
|
45
|
-
borderRadius: 30
|
|
46
|
-
}))
|
|
49
|
+
})
|
|
50
|
+
}
|
|
47
51
|
});
|
|
48
52
|
});
|
|
49
53
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
@@ -64,5 +68,5 @@ export default function SuccessButton(_a) {
|
|
|
64
68
|
React.useEffect(function () {
|
|
65
69
|
setBtnLoading(false);
|
|
66
70
|
}, []);
|
|
67
|
-
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr,
|
|
71
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ isAr: isAr, loading: btnLoading, disabled: disabled, type: 'button', variant: btnLoading ? 'contained' : 'outlined' }, props, { children: children })) }));
|
|
68
72
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LanguageMode } from '../../../@types';
|
|
3
3
|
import { useAppDispatch, useLanguage, useAppSelector } from '../../../hooks';
|
|
4
|
-
import { handleLanguage } from '../../../app/settings';
|
|
4
|
+
import { handleLanguage, settingsSelector } from '../../../app/settings';
|
|
5
5
|
import Footer from '../../../components/Footer';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { connectSelector } from '../../app/connect/connectStore';
|
|
8
7
|
export default function CustomFooter() {
|
|
9
8
|
var isEn = useLanguage().isEn;
|
|
10
9
|
var t = useTranslation().t;
|
|
11
10
|
var dispatch = useAppDispatch();
|
|
12
|
-
var data = useAppSelector(
|
|
11
|
+
var data = useAppSelector(settingsSelector).data;
|
|
13
12
|
var handleChangeLanguage = function () {
|
|
14
13
|
var language = isEn ? LanguageMode.AR : LanguageMode.EN;
|
|
15
14
|
dispatch(handleLanguage(language));
|
|
@@ -4,6 +4,7 @@ interface OTPProps extends OTPFieldProps {
|
|
|
4
4
|
timerInSeconds?: number;
|
|
5
5
|
onResetClick?: () => void;
|
|
6
6
|
timeEndLabel?: string;
|
|
7
|
+
loading?: boolean;
|
|
7
8
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ timeEndLabel, timerInSeconds, onResetClick, ...props }: OTPProps) => JSX.Element>;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ timeEndLabel, loading, timerInSeconds, onResetClick, ...props }: OTPProps) => JSX.Element>;
|
|
9
10
|
export default _default;
|
|
@@ -24,6 +24,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
24
24
|
import * as React from 'react';
|
|
25
25
|
import { styled } from '@mui/material/styles';
|
|
26
26
|
import Box from '@mui/material/Box/Box';
|
|
27
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
27
28
|
import OTPField from '../../../components/OTPField';
|
|
28
29
|
import OTPTimer from '../../../components/OTPTimer';
|
|
29
30
|
import { useContainerDimensions } from '../../../hooks';
|
|
@@ -71,8 +72,15 @@ var OTPBox = styled(Box)(function (_a) {
|
|
|
71
72
|
},
|
|
72
73
|
_b);
|
|
73
74
|
});
|
|
75
|
+
var LoaderBoxStyled = styled(OTPBox)(function (_a) {
|
|
76
|
+
var theme = _a.theme;
|
|
77
|
+
return ({
|
|
78
|
+
display: 'flex',
|
|
79
|
+
justifyContent: 'end'
|
|
80
|
+
});
|
|
81
|
+
});
|
|
74
82
|
var OTPInput = function (_a) {
|
|
75
|
-
var timeEndLabel = _a.timeEndLabel, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, props = __rest(_a, ["timeEndLabel", "timerInSeconds", "onResetClick"]);
|
|
83
|
+
var timeEndLabel = _a.timeEndLabel, loading = _a.loading, timerInSeconds = _a.timerInSeconds, onResetClick = _a.onResetClick, props = __rest(_a, ["timeEndLabel", "loading", "timerInSeconds", "onResetClick"]);
|
|
76
84
|
var otpRef = React.useRef(null);
|
|
77
85
|
var width = useContainerDimensions(otpRef).width;
|
|
78
86
|
React.useEffect(function () {
|
|
@@ -80,6 +88,6 @@ var OTPInput = function (_a) {
|
|
|
80
88
|
if (el)
|
|
81
89
|
el.className = 'middle-input-element';
|
|
82
90
|
}, [props.value]);
|
|
83
|
-
return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: _jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick }) }))] }));
|
|
91
|
+
return (_jsxs(_Fragment, { children: [_jsx(OTPBox, __assign({ id: 'otp-container', ref: otpRef }, { children: _jsx(OTPStyled, __assign({}, props, { parentWidth: width })) })), typeof timerInSeconds != 'undefined' && (_jsx(BoxStyled, { children: loading ? (_jsx(LoaderBoxStyled, { children: _jsx(CircularProgress, { size: 20, thickness: 5 }) })) : (_jsx(OTPTimer, { timeEndLabel: timeEndLabel || '', timeInSeconds: timerInSeconds, onResetClick: onResetClick })) }))] }));
|
|
84
92
|
};
|
|
85
93
|
export default React.memo(OTPInput);
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo, useEffect } from 'react';
|
|
14
|
-
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
|
|
14
|
+
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
|
|
15
15
|
import { handleLanguage, settingsSelector } from '../../app/settings';
|
|
16
16
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
17
17
|
import { store } from '../../app/store';
|
|
@@ -27,10 +27,11 @@ import Background from '../shared/Background';
|
|
|
27
27
|
var Tax = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
|
-
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error,
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
useErrorListener();
|
|
30
|
+
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, loading = _a.loading;
|
|
31
|
+
var _b = useAppSelector(taxSelector), customLoading = _b.customLoading, taxError = _b.error;
|
|
32
|
+
useAppConfig(__assign({ navigation: TAX_SCREENS_NAVIGATION }, props));
|
|
33
|
+
useErrorListener(taxError || error);
|
|
34
|
+
useStepStartedListener();
|
|
34
35
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
36
|
var verifyToken = function () {
|
|
36
37
|
var token = getParameterByName('token');
|
|
@@ -46,7 +47,7 @@ var Tax = memo(function (props) {
|
|
|
46
47
|
if (!loading)
|
|
47
48
|
verifyToken();
|
|
48
49
|
}, [loading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading:
|
|
50
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
50
51
|
var Element = _a.element, name = _a.name;
|
|
51
52
|
var isActive = activeScreen.name === name;
|
|
52
53
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -14,14 +14,15 @@ import React, { memo, useEffect, useState } from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
|
-
import { ICONS_NAMES } from '../../../../constants';
|
|
17
|
+
import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { allAreTruthy, showLastFour } from '../../../../utils';
|
|
19
|
+
import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
|
|
20
20
|
import { taxSelector } from '../../../app/tax/taxStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
24
24
|
import AcceptancePayouts from '../../../shared/AcceptancePayouts';
|
|
25
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
25
26
|
var TitleStyled = styled(Text)(function (_a) {
|
|
26
27
|
var _b;
|
|
27
28
|
var theme = _a.theme;
|
|
@@ -57,10 +58,13 @@ var SuccessWithFlowButtons = function () {
|
|
|
57
58
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
58
59
|
var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
|
|
59
60
|
var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
|
|
61
|
+
var settings = useAppSelector(settingsSelector);
|
|
62
|
+
var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
|
|
63
|
+
var email = (contact || { email: '' }).email;
|
|
64
|
+
var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
|
|
60
65
|
var reMapFlowData = function (flows) {
|
|
61
66
|
if (flows === void 0) { flows = []; }
|
|
62
67
|
var images = ICONS_NAMES;
|
|
63
|
-
var statuses = [];
|
|
64
68
|
var mappedFlows = flows.map(function (_a) {
|
|
65
69
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
66
70
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
@@ -79,6 +83,8 @@ var SuccessWithFlowButtons = function () {
|
|
|
79
83
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
80
84
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
81
85
|
return {
|
|
86
|
+
name: name,
|
|
87
|
+
status: status,
|
|
82
88
|
title: title,
|
|
83
89
|
href: url,
|
|
84
90
|
src: images[src],
|
|
@@ -96,6 +102,10 @@ var SuccessWithFlowButtons = function () {
|
|
|
96
102
|
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
97
103
|
reMapFlowData(flows);
|
|
98
104
|
}, [flows, isAr]);
|
|
99
|
-
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons
|
|
105
|
+
return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
|
|
106
|
+
flowName: data.flowName,
|
|
107
|
+
email: email,
|
|
108
|
+
emailUrl: url
|
|
109
|
+
} }) })] }));
|
|
100
110
|
};
|
|
101
111
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
16
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import CheckBox from '../../../../components/CheckBox';
|
|
19
|
+
import Text from '../../../../components/Text';
|
|
20
|
+
import Warning from '../../../../components/Warning';
|
|
21
|
+
import Collapse from '../../../../components/Collapse';
|
|
22
|
+
var ConfirmContainerStyled = styled(Box)(function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return ({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
padding: theme.spacing(0, 2.5, 0, 2.5)
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return (__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre-line', height: 'fit-content' }, theme.typography.body2));
|
|
34
|
+
});
|
|
35
|
+
var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
36
|
+
var theme = _a.theme;
|
|
37
|
+
return ({
|
|
38
|
+
margin: theme.spacing(0),
|
|
39
|
+
padding: theme.spacing(0),
|
|
40
|
+
marginInlineEnd: theme.spacing(1.5),
|
|
41
|
+
color: theme.palette.primary.main,
|
|
42
|
+
'& .MuiSvgIcon-root': {
|
|
43
|
+
fontSize: theme.spacing(3.75)
|
|
44
|
+
},
|
|
45
|
+
'&.Mui-checked': {
|
|
46
|
+
color: theme.palette.text.primary,
|
|
47
|
+
borderRadius: theme.spacing(2.5)
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var CollapseStyled = styled(Collapse)(function () { return ({
|
|
52
|
+
width: '100%'
|
|
53
|
+
}); });
|
|
54
|
+
var ConfirmPolicy = function () {
|
|
55
|
+
var _a;
|
|
56
|
+
var t = useTranslation().t;
|
|
57
|
+
var control = useFormContext().control;
|
|
58
|
+
var confirmControl = useController({ control: control, name: 'confirmPolicy' });
|
|
59
|
+
var confirmChecked = confirmControl.field.value;
|
|
60
|
+
var warningMessage = (_a = confirmControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
61
|
+
var handleConfirmCheckedChange = function (event, checked) {
|
|
62
|
+
confirmControl.field.onChange(checked);
|
|
63
|
+
};
|
|
64
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('tax_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
65
|
+
};
|
|
66
|
+
export default ConfirmPolicy;
|
|
@@ -22,9 +22,12 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
22
22
|
import { taxSelector, updateTaxInfo } from '../../../app/tax/taxStore';
|
|
23
23
|
import { handleCurrentActiveScreen } from '../../../../app/settings';
|
|
24
24
|
import VATId from './VATId';
|
|
25
|
+
import ConfirmPolicy from './ConfirmPolicy';
|
|
25
26
|
var FormStyled = styled(Form)(function () { return ({
|
|
27
|
+
height: '100%',
|
|
26
28
|
display: 'flex',
|
|
27
|
-
flexDirection: 'column'
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
justifyContent: 'space-between'
|
|
28
31
|
}); });
|
|
29
32
|
var TaxDetails = function () {
|
|
30
33
|
var dispatch = useAppDispatch();
|
|
@@ -42,6 +45,6 @@ var TaxDetails = function () {
|
|
|
42
45
|
var onBack = function () {
|
|
43
46
|
dispatch(handleCurrentActiveScreen('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
44
47
|
};
|
|
45
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
48
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(VATId, {}), _jsx(ConfirmPolicy, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
46
49
|
};
|
|
47
50
|
export default TaxDetails;
|
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
13
|
+
import Box from '@mui/material/Box';
|
|
3
14
|
import Input from '../../../shared/Input';
|
|
4
15
|
import { useTranslation } from 'react-i18next';
|
|
5
16
|
import { useController, useFormContext } from 'react-hook-form';
|
|
@@ -21,6 +32,6 @@ var VATId = function () {
|
|
|
21
32
|
var clearValue = function () {
|
|
22
33
|
vatControl.field.onChange('');
|
|
23
34
|
};
|
|
24
|
-
return (_jsx(
|
|
35
|
+
return (_jsx(Box, __assign({ sx: { height: '200px' } }, { children: _jsx(Input, { label: t('vat_id'), inputProps: { maxLength: VAT_ID_LENGTH }, value: vatValue, onChange: function (event) { return handleOnChange(event.target.value); }, placeholder: t('vat_id_placeholder'), warningType: 'alert', warningMessage: vatError && t(vatError), required: true, endAdornment: !vatError && vatValue ? _jsx(CheckIcon, {}) : vatValue && _jsx(ClearIcon, { onClick: clearValue }) }) })));
|
|
25
36
|
};
|
|
26
37
|
export default VATId;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const Validation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
4
5
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
6
|
vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
6
8
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
9
|
vatId: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
8
11
|
}>>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export var Validation = yup.object().shape({
|
|
3
|
-
vatId: yup.string().min(9, 'alert_vat').max(15, 'alert_vat').required('alert_vat')
|
|
3
|
+
vatId: yup.string().min(9, 'alert_vat').max(15, 'alert_vat').required('alert_vat'),
|
|
4
|
+
confirmPolicy: yup.boolean().required('alert_tax_confirm').isTrue('alert_tax_confirm')
|
|
4
5
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface OTPProps {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
setLoading: (flag: boolean) => void;
|
|
3
5
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
|
|
6
|
+
declare const _default: React.MemoExoticComponent<({ loading, setLoading }: OTPProps) => JSX.Element>;
|
|
5
7
|
export default _default;
|
|
@@ -11,12 +11,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
14
15
|
import Box from '@mui/material/Box/Box';
|
|
15
16
|
import { styled } from '@mui/material/styles';
|
|
16
17
|
import OTPField from '../../../shared/OTP';
|
|
17
18
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
19
|
import { useTranslation } from 'react-i18next';
|
|
19
20
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
|
+
import { resendOTP } from '../../../app/tax/taxStore';
|
|
20
22
|
var BoxStyled = styled(Box)(function (_a) {
|
|
21
23
|
var theme = _a.theme;
|
|
22
24
|
return ({
|
|
@@ -26,17 +28,20 @@ var BoxStyled = styled(Box)(function (_a) {
|
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
var OTPInput = function (_a) {
|
|
31
|
+
var loading = _a.loading, setLoading = _a.setLoading;
|
|
29
32
|
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
30
33
|
var t = useTranslation().t;
|
|
31
34
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
+
var dispatch = useAppDispatch();
|
|
32
36
|
var handleOnOTPChange = function (otp) {
|
|
33
37
|
otpControl.field.onChange(otp);
|
|
34
38
|
};
|
|
35
39
|
var handleOnResendOTP = function () {
|
|
36
40
|
if (otpControl.field.value)
|
|
37
41
|
setValue('otp', '', { shouldValidate: true });
|
|
42
|
+
dispatch(resendOTP());
|
|
38
43
|
};
|
|
39
44
|
var otpValue = otpControl.field.value;
|
|
40
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
45
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
41
46
|
};
|
|
42
47
|
export default React.memo(OTPInput);
|
|
@@ -57,6 +57,7 @@ var VerifyNumber = function (_a) {
|
|
|
57
57
|
});
|
|
58
58
|
var t = useTranslation().t;
|
|
59
59
|
var isAr = useLanguage().isAr;
|
|
60
|
+
var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
|
|
60
61
|
React.useEffect(function () {
|
|
61
62
|
if (error)
|
|
62
63
|
dispatch(clearError());
|
|
@@ -71,7 +72,7 @@ var VerifyNumber = function (_a) {
|
|
|
71
72
|
dispatch(handlePrevScreenStep());
|
|
72
73
|
};
|
|
73
74
|
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
74
|
-
var disabled = !methods.formState.isValid || !!error || !phone;
|
|
75
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
75
|
+
var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
|
|
76
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
76
77
|
};
|
|
77
78
|
export default React.memo(VerifyNumber);
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -2,8 +2,5 @@ import { LibConfig, ScreenStepNavigation } from '../@types';
|
|
|
2
2
|
interface AppConfigProps extends LibConfig {
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
4
|
}
|
|
5
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, ...rest }: AppConfigProps) =>
|
|
6
|
-
loading: boolean;
|
|
7
|
-
error: string | null;
|
|
8
|
-
};
|
|
5
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, ...rest }: AppConfigProps) => void;
|
|
9
6
|
export {};
|
|
@@ -9,42 +9,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
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;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
12
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
13
|
var t = {};
|
|
50
14
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -56,20 +20,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
56
20
|
}
|
|
57
21
|
return t;
|
|
58
22
|
};
|
|
59
|
-
import { useEffect
|
|
60
|
-
import { handleActiveFlowScreens,
|
|
23
|
+
import { useEffect } from 'react';
|
|
24
|
+
import { handleActiveFlowScreens, handleSetAppConfig, handleLanguage, handleOpen, handleIsTapOrigin, fetchAppSettingsSync } from '../app/settings';
|
|
61
25
|
import { useAppDispatch } from './useAppDispatch';
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import { getRequestHeaders, encryptString, isTapDomain } from '../utils';
|
|
26
|
+
import { axiosInstance } from '../api';
|
|
27
|
+
import { isTapDomain, removeRequestHeaders } from '../utils';
|
|
65
28
|
import { ENDPOINT_PATHS } from '../constants';
|
|
66
29
|
export var useAppConfig = function (_a) {
|
|
67
30
|
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, rest = __rest(_a, ["appInfo", "navigation", "publicKey"]);
|
|
68
|
-
var _b = useState(true), loading = _b[0], setLoading = _b[1];
|
|
69
31
|
var dispatch = useAppDispatch();
|
|
70
|
-
var _c = useAppSelector(settingsSelector), data = _c.data, error = _c.error;
|
|
71
|
-
var deviceInfo = data.deviceInfo, language = data.language, appConfig = data.appConfig;
|
|
72
|
-
var device = deviceInfo.device, browser = deviceInfo.browser, connection = deviceInfo.connection;
|
|
73
32
|
var setBaseUrl = function () {
|
|
74
33
|
var isProd = publicKey.includes('pk_live');
|
|
75
34
|
if (isProd) {
|
|
@@ -78,79 +37,23 @@ export var useAppConfig = function (_a) {
|
|
|
78
37
|
}
|
|
79
38
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
|
|
80
39
|
};
|
|
81
|
-
var
|
|
82
|
-
|
|
40
|
+
var setAppConfig = function () {
|
|
41
|
+
dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey }, rest)));
|
|
42
|
+
dispatch(handleActiveFlowScreens(navigation));
|
|
83
43
|
};
|
|
84
|
-
var handleAppConfig = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
dispatch(handleSetAppConfig(__assign({ appInfo: appInfo, publicKey: publicKey }, rest)));
|
|
87
|
-
setBaseUrl();
|
|
88
|
-
dispatch(handleActiveFlowScreens(navigation));
|
|
89
|
-
return [2];
|
|
90
|
-
});
|
|
91
|
-
}); };
|
|
92
44
|
var checkDomain = function () {
|
|
93
45
|
var isTap = isTapDomain(rest.merchantDomain);
|
|
94
46
|
dispatch(handleIsTapOrigin(isTap));
|
|
95
47
|
};
|
|
96
|
-
var handleAppApiConfig = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
97
|
-
return __generator(this, function (_a) {
|
|
98
|
-
switch (_a.label) {
|
|
99
|
-
case 0:
|
|
100
|
-
checkDomain();
|
|
101
|
-
return [4, dispatch(getLocale())];
|
|
102
|
-
case 1:
|
|
103
|
-
_a.sent();
|
|
104
|
-
return [4, dispatch(getClientIp())];
|
|
105
|
-
case 2:
|
|
106
|
-
_a.sent();
|
|
107
|
-
return [4, dispatch(getBrowserFingerPrint(appInfo))];
|
|
108
|
-
case 3:
|
|
109
|
-
_a.sent();
|
|
110
|
-
return [2];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}); };
|
|
114
|
-
var handleGetOperator = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
-
var payload;
|
|
116
|
-
var _a, _b;
|
|
117
|
-
return __generator(this, function (_c) {
|
|
118
|
-
switch (_c.label) {
|
|
119
|
-
case 0:
|
|
120
|
-
payload = {
|
|
121
|
-
type: 'website',
|
|
122
|
-
app_client_version: 'js-auth-connect',
|
|
123
|
-
requirer_browser: "".concat(browser === null || browser === void 0 ? void 0 : browser.name, " , ").concat(browser === null || browser === void 0 ? void 0 : browser.version),
|
|
124
|
-
os: "".concat((_a = device.os) === null || _a === void 0 ? void 0 : _a.name, " , ").concat((_b = device.os) === null || _b === void 0 ? void 0 : _b.version),
|
|
125
|
-
locale: language
|
|
126
|
-
};
|
|
127
|
-
return [4, dispatch(getOperator(payload))];
|
|
128
|
-
case 1:
|
|
129
|
-
_c.sent();
|
|
130
|
-
setLoading(false);
|
|
131
|
-
return [2];
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}); };
|
|
135
48
|
useEffect(function () {
|
|
136
49
|
dispatch(handleOpen(rest.open));
|
|
137
50
|
}, [rest.open]);
|
|
138
51
|
useEffect(function () {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
52
|
+
removeRequestHeaders();
|
|
53
|
+
checkDomain();
|
|
54
|
+
setBaseUrl();
|
|
55
|
+
setAppConfig();
|
|
56
|
+
dispatch(handleLanguage(rest.language));
|
|
57
|
+
dispatch(fetchAppSettingsSync());
|
|
144
58
|
}, []);
|
|
145
|
-
useEffect(function () {
|
|
146
|
-
if (appConfig.publicKey)
|
|
147
|
-
handleAppApiConfig();
|
|
148
|
-
}, [appConfig]);
|
|
149
|
-
useEffect(function () {
|
|
150
|
-
if (connection.ip && browser.browser_id) {
|
|
151
|
-
addAxiosHeader();
|
|
152
|
-
handleGetOperator();
|
|
153
|
-
}
|
|
154
|
-
}, [connection, browser]);
|
|
155
|
-
return { loading: loading, error: error };
|
|
156
59
|
};
|
|
@@ -6,5 +6,4 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
6
6
|
tax: import("../features/app/tax/taxStore").TaxState;
|
|
7
7
|
individual: import("../features/app/individual/individualStore").IndividualState;
|
|
8
8
|
password: import("../features/app/password/passwordStore").PasswordState;
|
|
9
|
-
landing: import("../features/app/landing/landingStore").LandingState;
|
|
10
9
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|