@tap-payments/auth-jsconnect 2.10.0-beta → 2.10.0-sandbox
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/app.d.ts +7 -1
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +3 -0
- package/build/api/account.d.ts +1 -0
- package/build/api/account.js +7 -0
- package/build/api/auth.d.ts +1 -0
- package/build/api/index.d.ts +1 -0
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +9 -4
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +4 -0
- package/build/assets/locales/ar.json +10 -1
- package/build/assets/locales/en.json +36 -1
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/constants/api.d.ts +1 -1
- package/build/constants/api.js +2 -2
- package/build/constants/app.d.ts +3 -1
- package/build/constants/app.js +42 -13
- package/build/constants/assets.d.ts +4 -0
- package/build/constants/assets.js +9 -2
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +186 -89
- package/build/features/app/business/businessStore.js +53 -29
- package/build/features/app/connect/connectStore.js +47 -35
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +301 -109
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/kyc/kycStore.js +49 -25
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +4 -6
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/featuresScreens.js +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/kyc/screens/Terms/Terms.js +8 -2
- package/build/features/kyc/screens/Users/Users.js +1 -1
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +1 -2
- package/build/features/shared/Button/FlowsButtons.js +2 -1
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/hooks/useAppConfig.js +1 -1
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +6 -4
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/string.d.ts +1 -1
- package/package.json +3 -4
|
@@ -0,0 +1,49 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import Box from '@mui/material/Box/Box';
|
|
17
|
+
import { styled } from '@mui/material/styles';
|
|
18
|
+
import OTPField from '../../../shared/OTP';
|
|
19
|
+
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
+
import { connectExpressSelector, clearError, resendLeadMobileAuthOTP } from '../../../app/connectExpress/connectExpressStore';
|
|
21
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return ({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
fontFamily: theme.typography.fontFamily
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
var OTPInput = function (_a) {
|
|
31
|
+
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
32
|
+
var t = useTranslation().t;
|
|
33
|
+
var dispatch = useAppDispatch();
|
|
34
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
35
|
+
var error = useAppSelector(connectExpressSelector).error;
|
|
36
|
+
var handleOnOTPChange = function (otp) {
|
|
37
|
+
if (error)
|
|
38
|
+
dispatch(clearError());
|
|
39
|
+
otpControl.field.onChange(otp);
|
|
40
|
+
};
|
|
41
|
+
var handleOnResendOTP = function () {
|
|
42
|
+
if (otpControl.field.value)
|
|
43
|
+
setValue('otp', '', { shouldValidate: true });
|
|
44
|
+
dispatch(resendLeadMobileAuthOTP());
|
|
45
|
+
};
|
|
46
|
+
var otpValue = otpControl.field.value;
|
|
47
|
+
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()); } }) })));
|
|
48
|
+
};
|
|
49
|
+
export default React.memo(OTPInput);
|
|
@@ -0,0 +1,88 @@
|
|
|
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 Box from '@mui/material/Box/Box';
|
|
14
|
+
import { styled } from '@mui/material/styles';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import { useTranslation } from 'react-i18next';
|
|
17
|
+
import Text from '../../../../components/Text';
|
|
18
|
+
import { clearError, connectExpressSelector, verifyAuthMobileOtpAsync, resetVerifyAuthOTPValue } from '../../../app/connectExpress/connectExpressStore';
|
|
19
|
+
import Button from '../../../shared/Button';
|
|
20
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import { useAppDispatch, useAppSelector, useSanitizedTranslation } from '../../../../hooks';
|
|
22
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
|
+
import { useLanguage } from '../../../../hooks';
|
|
24
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
25
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
26
|
+
import Form from '../../../../components/Form';
|
|
27
|
+
import { maskPhone, deepCopy } from '../../../../utils';
|
|
28
|
+
import { AuthForScreen } from '../../../../@types';
|
|
29
|
+
import { OTPValidation } from './validation';
|
|
30
|
+
import OTPInput from './OTPInput';
|
|
31
|
+
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
32
|
+
var theme = _a.theme;
|
|
33
|
+
return ({
|
|
34
|
+
background: theme.palette.common.white,
|
|
35
|
+
border: '1px solid',
|
|
36
|
+
borderColor: theme.palette.divider,
|
|
37
|
+
direction: theme.direction,
|
|
38
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
39
|
+
marginBottom: theme.spacing(5.75)
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
43
|
+
var theme = _a.theme;
|
|
44
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
45
|
+
});
|
|
46
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
47
|
+
display: 'flex',
|
|
48
|
+
flexDirection: 'column'
|
|
49
|
+
}); });
|
|
50
|
+
var VerifyMobileAuthOTP = function () {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f;
|
|
52
|
+
var dispatch = useAppDispatch();
|
|
53
|
+
var _g = useAppSelector(connectExpressSelector), data = _g.data, loading = _g.loading, error = _g.error;
|
|
54
|
+
var t = useTranslation().t;
|
|
55
|
+
var st = useSanitizedTranslation();
|
|
56
|
+
var isAr = useLanguage().isAr;
|
|
57
|
+
var methods = useForm({
|
|
58
|
+
resolver: yupResolver(OTPValidation),
|
|
59
|
+
defaultValues: data.verifyAuthOtpData,
|
|
60
|
+
mode: 'onChange'
|
|
61
|
+
});
|
|
62
|
+
React.useEffect(function () {
|
|
63
|
+
if (error)
|
|
64
|
+
dispatch(clearError());
|
|
65
|
+
}, [methods.formState.isValid]);
|
|
66
|
+
React.useEffect(function () {
|
|
67
|
+
return function () {
|
|
68
|
+
dispatch(resetVerifyAuthOTPValue());
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
71
|
+
var onSubmit = function (formData) {
|
|
72
|
+
dispatch(verifyAuthMobileOtpAsync(deepCopy(formData)));
|
|
73
|
+
};
|
|
74
|
+
var onBack = function () {
|
|
75
|
+
var authFor = data.verifyAuthOtpData.authFor;
|
|
76
|
+
var step_name = 'CONNECT_EXPRESS_COLLECT_INDIVIDUAL_INFO_STEP';
|
|
77
|
+
if (authFor === AuthForScreen.DOB)
|
|
78
|
+
step_name = 'CONNECT_EXPRESS_COLLECT_DOB_INFO_STEP';
|
|
79
|
+
else if (authFor === AuthForScreen.MOBILE_OWNERSHIP)
|
|
80
|
+
step_name = 'COLLECT_MOBILE_OWNERSHIP';
|
|
81
|
+
dispatch(handlePrevScreenStep(step_name));
|
|
82
|
+
};
|
|
83
|
+
var disabled = !methods.formState.isValid;
|
|
84
|
+
var phone = ((_c = (_b = (_a = data.responseData) === null || _a === void 0 ? void 0 : _a.verifyAuthMobile) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to) ? (_f = (_e = (_d = data.responseData) === null || _d === void 0 ? void 0 : _d.verifyAuthMobile) === null || _e === void 0 ? void 0 : _e.verification_by) === null || _f === void 0 ? void 0 : _f.sent_to : '';
|
|
85
|
+
var title = t('ide_opt_sent_title');
|
|
86
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? st('ide_otp_waiting_title') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: st(error || '') }, { children: t('next') }))] })) })) }));
|
|
87
|
+
};
|
|
88
|
+
export default React.memo(VerifyMobileAuthOTP);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
+
otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>>;
|
|
@@ -4,14 +4,16 @@ import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectE
|
|
|
4
4
|
import NafathVerification from '../../../shared/NafathVerification';
|
|
5
5
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
6
6
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
7
|
+
import GenericPrepareDataLoading from '../GenericPrepareDataLoading';
|
|
7
8
|
var VerifyNafath = function () {
|
|
8
9
|
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
9
10
|
var _b = React.useState(false), failed = _b[0], setFailed = _b[1];
|
|
10
11
|
var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
|
|
12
|
+
var _d = React.useState(false), showLoadingScreen = _d[0], setShowLoadingScreen = _d[1];
|
|
11
13
|
var dispatch = useAppDispatch();
|
|
12
14
|
var data = useAppSelector(connectExpressSelector).data;
|
|
13
15
|
var authData = (data.responseData || {}).authData;
|
|
14
|
-
var
|
|
16
|
+
var _e = authData || {}, expiry = _e.expiry, app_url_android = _e.app_url_android, app_url_ios = _e.app_url_ios, random = _e.random;
|
|
15
17
|
React.useEffect(function () {
|
|
16
18
|
if (authData && !isReady) {
|
|
17
19
|
setIsReady(true);
|
|
@@ -20,7 +22,11 @@ var VerifyNafath = function () {
|
|
|
20
22
|
React.useEffect(function () {
|
|
21
23
|
if (!isReady)
|
|
22
24
|
return;
|
|
23
|
-
var promise = dispatch(verifyNafathAsync({
|
|
25
|
+
var promise = dispatch(verifyNafathAsync({
|
|
26
|
+
onSuccess: function () { return setSuccess(true); },
|
|
27
|
+
onFailure: function () { return setFailed(true); },
|
|
28
|
+
showLoadingScreenAfterNafathSuccess: function () { return setShowLoadingScreen(true); }
|
|
29
|
+
}));
|
|
24
30
|
return function () {
|
|
25
31
|
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
26
32
|
};
|
|
@@ -30,6 +36,6 @@ var VerifyNafath = function () {
|
|
|
30
36
|
}, []);
|
|
31
37
|
if (!isReady)
|
|
32
38
|
return null;
|
|
33
|
-
return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
39
|
+
return showLoadingScreen ? (_jsx(GenericPrepareDataLoading, {})) : (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, failed: failed, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
34
40
|
};
|
|
35
41
|
export default React.memo(VerifyNafath);
|
|
@@ -15,11 +15,12 @@ import { useTranslation } from 'react-i18next';
|
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
17
|
import { settingsSelector } from '../../../../app/settings';
|
|
18
|
-
import { formatNumberAsCurrency,
|
|
18
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError } from '../../../app/entity/entityStore';
|
|
22
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
23
24
|
var CapitalPaid = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
@@ -34,14 +35,9 @@ var CapitalPaid = function (_a) {
|
|
|
34
35
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
35
36
|
capitalPaidControl.field.onChange(value);
|
|
36
37
|
};
|
|
37
|
-
var getCurrency = React.useMemo(function () {
|
|
38
|
-
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
-
}, [settingsData.businessCountry.iso2]);
|
|
40
38
|
var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
|
|
41
39
|
var capitalPaidValue = capitalPaidControl.field.value;
|
|
42
40
|
var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
|
-
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
44
|
-
currency: getCurrency
|
|
45
|
-
}), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_paid_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
|
|
46
42
|
};
|
|
47
43
|
export default React.memo(CapitalPaid);
|
|
@@ -13,13 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { formatNumberAsCurrency,
|
|
16
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
17
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError } from '../../../app/entity/entityStore';
|
|
22
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
23
24
|
var CapitalShareValue = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
@@ -34,14 +35,9 @@ var CapitalShareValue = function (_a) {
|
|
|
34
35
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
35
36
|
capitalShareValueControl.field.onChange(value);
|
|
36
37
|
};
|
|
37
|
-
var getCurrency = React.useMemo(function () {
|
|
38
|
-
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
-
}, [settingsData.businessCountry.iso2]);
|
|
40
38
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
41
39
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
42
40
|
var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
|
-
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
44
|
-
currency: getCurrency
|
|
45
|
-
}), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
46
42
|
};
|
|
47
43
|
export default React.memo(CapitalShareValue);
|
|
@@ -27,6 +27,7 @@ import ConnectExpressIdentityVerifyNafathScreen from './connectExpress/screens/I
|
|
|
27
27
|
import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
|
|
28
28
|
import ConnectExpressCollectDobScreen from './connectExpress/screens/DOB';
|
|
29
29
|
import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
|
|
30
|
+
import ConnectExpressVerifyAuthMobileOtpScreen from './connectExpress/screens/VerifyMobileAuthOTP';
|
|
30
31
|
import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
|
|
31
32
|
import ConnectExpressPreparingDataLoaderScreen from './connectExpress/screens/PrepareDataLoading';
|
|
32
33
|
import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/SuccessWithFlowButtons';
|
|
@@ -56,6 +57,7 @@ import AuthAccountCreatedLoaderScreen from './auth/screens/AccountCreatedLoader'
|
|
|
56
57
|
import AuthEmailSentScreen from './auth/screens/EmailSent';
|
|
57
58
|
import AuthMigratingDataScreen from './auth/screens/MigratingData';
|
|
58
59
|
import AuthOperatorError from './auth/screens/OperatorError';
|
|
60
|
+
import AuthPasscodeScreen from './auth/screens/Passcode';
|
|
59
61
|
import CustomersPage from './business/screens/Customers';
|
|
60
62
|
import IDBODPage from './business/screens/IDBOD';
|
|
61
63
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
@@ -262,6 +264,10 @@ export var connectExpressFeatureScreens = [
|
|
|
262
264
|
name: 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
263
265
|
element: ConnectExpressCollectBusinessScreen
|
|
264
266
|
},
|
|
267
|
+
{
|
|
268
|
+
name: 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP',
|
|
269
|
+
element: ConnectExpressVerifyAuthMobileOtpScreen
|
|
270
|
+
},
|
|
265
271
|
{
|
|
266
272
|
name: 'CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP',
|
|
267
273
|
element: ConnectExpressAccountAlreadyCreatedScreen
|
|
@@ -320,6 +326,10 @@ export var authFeatureScreens = [
|
|
|
320
326
|
name: 'AUTH_OTP_STEP',
|
|
321
327
|
element: AuthOTPScreen
|
|
322
328
|
},
|
|
329
|
+
{
|
|
330
|
+
name: 'AUTH_PASSCODE_STEP',
|
|
331
|
+
element: AuthPasscodeScreen
|
|
332
|
+
},
|
|
323
333
|
{
|
|
324
334
|
name: 'AUTH_PASSWORD_STEP',
|
|
325
335
|
element: AuthPasswordScreen
|
|
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
-
import {
|
|
19
|
+
import { hasVerifiedValue } from '../../../../utils';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -26,6 +26,7 @@ import InputSelect from '../../../shared/InputSelect';
|
|
|
26
26
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
27
27
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
28
28
|
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
29
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
29
30
|
var Container = styled(Box)(function () { return ({
|
|
30
31
|
display: 'flex'
|
|
31
32
|
}); });
|
|
@@ -45,16 +46,12 @@ var MonthlyIncome = function (props) {
|
|
|
45
46
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
46
47
|
var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
|
|
47
48
|
var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
|
|
48
|
-
var countryCode = settingsData.businessCountry;
|
|
49
49
|
var user = (data.verify.responseBody || {}).user;
|
|
50
50
|
var isMonthlyIncomeVerified = function (item) {
|
|
51
51
|
if (!(item === null || item === void 0 ? void 0 : item.id))
|
|
52
52
|
return false;
|
|
53
53
|
return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
|
|
54
54
|
};
|
|
55
|
-
var getCurrency = React.useMemo(function () {
|
|
56
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
57
|
-
}, [countryCode.iso2]);
|
|
58
55
|
React.useEffect(function () {
|
|
59
56
|
if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
|
|
60
57
|
setIncomeList(monthlyIncomeList);
|
|
@@ -83,9 +80,7 @@ var MonthlyIncome = function (props) {
|
|
|
83
80
|
};
|
|
84
81
|
var income = monthlyIncomeControl.field.value;
|
|
85
82
|
var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('
|
|
87
|
-
currency: getCurrency
|
|
88
|
-
}), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: _jsx(TextWithCurrency, { text: t('monthly_income'), countryCode: settingsData.businessCountry.iso2 }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
89
84
|
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
|
|
90
85
|
} }) }))] })) })));
|
|
91
86
|
};
|
|
@@ -14,13 +14,14 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
|
-
import { formatNumberAsCurrency,
|
|
17
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
23
23
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
24
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
24
25
|
var ShareValue = function (_a) {
|
|
25
26
|
var _b;
|
|
26
27
|
var show = _a.show, readOnly = _a.readOnly;
|
|
@@ -29,7 +30,6 @@ var ShareValue = function (_a) {
|
|
|
29
30
|
var control = useFormContext().control;
|
|
30
31
|
var bckError = useAppSelector(individualSelector).error;
|
|
31
32
|
var dispatch = useAppDispatch();
|
|
32
|
-
var countryCode = settingsData.businessCountry;
|
|
33
33
|
var handleChange = function (_a) {
|
|
34
34
|
var target = _a.target;
|
|
35
35
|
if (bckError)
|
|
@@ -37,14 +37,9 @@ var ShareValue = function (_a) {
|
|
|
37
37
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
38
38
|
shareValueControl.field.onChange(value);
|
|
39
39
|
};
|
|
40
|
-
var getCurrency = React.useMemo(function () {
|
|
41
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
42
|
-
}, [countryCode.iso2]);
|
|
43
40
|
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
|
44
41
|
var shareValue = shareValueControl.field.value;
|
|
45
42
|
var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
46
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
47
|
-
currency: getCurrency
|
|
48
|
-
}), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
|
|
49
44
|
};
|
|
50
45
|
export default React.memo(ShareValue);
|
|
@@ -15,7 +15,7 @@ import { handleNextScreenStep, settingsSelector } from '../../../../app/settings
|
|
|
15
15
|
import Box from '@mui/material/Box';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import { useAppDispatch, useAppSelector, useLanguage, useSanitizedTranslation } from '../../../../hooks';
|
|
18
|
-
import { getWebsiteLink, isSA, maskIDNumber } from '../../../../utils';
|
|
18
|
+
import { getWebsiteLink, isOtherThanKWOrSA, isSA, maskIDNumber } from '../../../../utils';
|
|
19
19
|
import { CONNECT_FLOWS, EXTERNAL_LINKS } from '../../../../constants';
|
|
20
20
|
import Button from '../../../shared/Button';
|
|
21
21
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
@@ -55,6 +55,7 @@ export var Terms = function () {
|
|
|
55
55
|
var termsAndConditionsLink = getWebsiteLink(isAr, countryCode, EXTERNAL_LINKS.TERMS_CONDITIONS);
|
|
56
56
|
var privacyPolicyLink = getWebsiteLink(isAr, countryCode, EXTERNAL_LINKS.PRIVACY_POLICY);
|
|
57
57
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
58
|
+
var isOtherThanKWOrSACountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
58
59
|
var onNext = function () {
|
|
59
60
|
if (hasOneUserOnly) {
|
|
60
61
|
if (isSACountry) {
|
|
@@ -76,6 +77,11 @@ export var Terms = function () {
|
|
|
76
77
|
}
|
|
77
78
|
dispatch(handleNextScreenStep(CONNECT_FLOWS.kyc.users));
|
|
78
79
|
};
|
|
79
|
-
|
|
80
|
+
var getNextButtonTitle = function () {
|
|
81
|
+
if (isOtherThanKWOrSACountry)
|
|
82
|
+
return st('continue');
|
|
83
|
+
return isSACountry ? st('approve_with_nafath_app') : st('approve_with_paci_app');
|
|
84
|
+
};
|
|
85
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(Header, { idNumber: idNumber }), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_terms_conditions') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_refund_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(termsAndConditionsLink); } }, { children: st('kyc_dispute_policy') })), _jsx(BoxStyled, __assign({ onClick: function () { return redirect(privacyPolicyLink); }, sx: { mb: error ? 3 : 0 } }, { children: st('kyc_privacy_policy') })), _jsx(Button, __assign({ disabled: isOtherThanKWOrSACountry, sx: { mt: 3 }, disableBack: true, isAr: isAr, loading: loading, error: st(error || ''), onClick: onNext }, { children: getNextButtonTitle() }))] }));
|
|
80
86
|
};
|
|
81
87
|
export default memo(Terms);
|
|
@@ -69,7 +69,7 @@ var Users = function () {
|
|
|
69
69
|
})
|
|
70
70
|
.catch(function () { });
|
|
71
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) {
|
|
72
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { pl: 2, pr: 2, pb: 3 } }, { children: [_jsx(DescriptionStyled, { children: st('kyc_users_description', { provider: isSACountry ? 'NAFATH' : 'PACI' }) }), userList.map(function (user, index) {
|
|
73
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
74
|
}), error && (_jsx(Warning, __assign({ sx: { mt: 3, mb: 3 }, warningType: 'error' }, { children: error })))] })));
|
|
75
75
|
};
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import Icon from '../../../components/Icon';
|
|
6
6
|
import { ICONS_NAMES } from '../../../constants';
|
|
7
|
-
import { useLanguage } from '../../../hooks';
|
|
8
7
|
var BoxStyled = styled(Box)(function (_a) {
|
|
9
8
|
var _b;
|
|
10
9
|
var theme = _a.theme;
|
|
11
10
|
return (_b = {
|
|
12
11
|
display: 'flex',
|
|
13
|
-
flexDirection: 'column',
|
|
14
12
|
justifyContent: 'center',
|
|
15
|
-
|
|
16
|
-
paddingTop: theme.spacing(5)
|
|
13
|
+
paddingTop: theme.spacing(10)
|
|
17
14
|
},
|
|
18
15
|
_b[theme.breakpoints.down('sm')] = {
|
|
19
16
|
paddingTop: theme.spacing(11)
|
|
@@ -23,20 +20,11 @@ var BoxStyled = styled(Box)(function (_a) {
|
|
|
23
20
|
var LogoBadgeStyled = styled(Icon)(function (_a) {
|
|
24
21
|
var theme = _a.theme;
|
|
25
22
|
return ({
|
|
26
|
-
height: theme.spacing(
|
|
27
|
-
width: theme.spacing(
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
var LogoIconStyled = styled(Icon)(function (_a) {
|
|
31
|
-
var theme = _a.theme;
|
|
32
|
-
return ({
|
|
33
|
-
width: theme.spacing(5.875),
|
|
34
|
-
height: theme.spacing(3.625),
|
|
35
|
-
marginTop: theme.spacing(2.5)
|
|
23
|
+
height: theme.spacing(9.5),
|
|
24
|
+
width: theme.spacing(19.322)
|
|
36
25
|
});
|
|
37
26
|
});
|
|
38
27
|
var LogoBackground = function () {
|
|
39
|
-
|
|
40
|
-
return (_jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' })] }));
|
|
28
|
+
return (_jsx(BoxStyled, { children: _jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO, alt: 'tap logo' }) }));
|
|
41
29
|
};
|
|
42
30
|
export default memo(LogoBackground);
|
|
@@ -53,8 +53,7 @@ var BackIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return
|
|
|
53
53
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
54
54
|
var theme = _a.theme;
|
|
55
55
|
return ({
|
|
56
|
-
margin: theme.spacing(
|
|
57
|
-
marginBlockStart: theme.spacing(5),
|
|
56
|
+
margin: theme.spacing(5, 2.5, 2.5, 2.5),
|
|
58
57
|
maxHeight: theme.spacing(5.375),
|
|
59
58
|
display: 'flex',
|
|
60
59
|
alignItems: 'center',
|
|
@@ -163,6 +163,7 @@ export default function FlowsButtons(_a) {
|
|
|
163
163
|
var isAr = useLanguage().isAr;
|
|
164
164
|
var t = useTranslation().t;
|
|
165
165
|
var onRedirect = function (item) {
|
|
166
|
+
var _a;
|
|
166
167
|
if (!item.href)
|
|
167
168
|
return;
|
|
168
169
|
var name = item.name === FlowsTypes.BANK ? 'Wallet' : capitalize(item.name);
|
|
@@ -180,7 +181,7 @@ export default function FlowsButtons(_a) {
|
|
|
180
181
|
return;
|
|
181
182
|
}
|
|
182
183
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
|
183
|
-
settingsData.appConfig.onBoardButtonClick({ name: item.name, token: item.token });
|
|
184
|
+
settingsData.appConfig.onBoardButtonClick({ name: item.name, token: item.token, countryCode: (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2 });
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
187
|
dispatch(handleOpen(false));
|
|
@@ -20,7 +20,7 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
|
|
|
20
20
|
warningType?: "alert" | "error" | "hint" | undefined;
|
|
21
21
|
} & {} & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
22
22
|
export interface CustomInputProps extends InputProps {
|
|
23
|
-
label?: string;
|
|
23
|
+
label?: string | JSX.Element;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
labelSx?: SxProps<Theme>;
|
|
26
26
|
}
|
|
@@ -48,7 +48,7 @@ export var useAppConfig = function (_a) {
|
|
|
48
48
|
if (!disableSettingFetching && !configToken)
|
|
49
49
|
removeRequestHeaders();
|
|
50
50
|
checkDomain();
|
|
51
|
-
setBaseUrl(publicKey);
|
|
51
|
+
setBaseUrl(publicKey, rest.businessCountryCode);
|
|
52
52
|
setAppConfig();
|
|
53
53
|
if (typeof boardMaturity === 'boolean')
|
|
54
54
|
dispatch(handelBoardMaturity(boardMaturity));
|
package/build/utils/common.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const sleep: (milliseconds?: number) => Promise<unknown>;
|
|
2
2
|
export declare const dangerousMessage: (message: string, callBack?: Function) => void;
|
|
3
|
-
export declare const setBaseUrl: (publicKey: string) => void;
|
|
3
|
+
export declare const setBaseUrl: (publicKey: string, countryCode?: string) => void;
|
|
4
4
|
export declare const updateLocationUrlWithCountry: (countryIso2: string) => void;
|
|
5
5
|
export declare const openConnect: (pk: string, countryCode?: string) => void;
|
|
6
6
|
export declare function getMetaData(): Record<string, string> | undefined;
|
package/build/utils/common.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { axiosInstance } from '../api';
|
|
2
|
-
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL,
|
|
2
|
+
import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_PROD_URL } from '../constants';
|
|
3
3
|
import { objectHasValues } from './object';
|
|
4
|
+
import { isSA } from './string';
|
|
4
5
|
export var sleep = function (milliseconds) {
|
|
5
6
|
if (milliseconds === void 0) { milliseconds = 1000; }
|
|
6
7
|
return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
|
|
@@ -11,10 +12,11 @@ export var dangerousMessage = function (message, callBack) {
|
|
|
11
12
|
}
|
|
12
13
|
callBack === null || callBack === void 0 ? void 0 : callBack({ message: message });
|
|
13
14
|
};
|
|
14
|
-
export var setBaseUrl = function (publicKey) {
|
|
15
|
+
export var setBaseUrl = function (publicKey, countryCode) {
|
|
16
|
+
if (countryCode === void 0) { countryCode = ''; }
|
|
15
17
|
var isProd = publicKey.includes('pk_live');
|
|
16
18
|
if (isProd) {
|
|
17
|
-
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.
|
|
19
|
+
axiosInstance.defaults.baseURL = isSA(countryCode) ? ENDPOINT_PATHS.PRODUCTION_BASE_URL_SA : ENDPOINT_PATHS.PRODUCTION_BASE_URL;
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
22
|
axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
|
|
@@ -36,7 +38,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
|
|
|
36
38
|
window.history.replaceState({}, '', newUrl);
|
|
37
39
|
};
|
|
38
40
|
export var openConnect = function (pk, countryCode) {
|
|
39
|
-
var newUrl = new URL(pk.includes('pk_live') ?
|
|
41
|
+
var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_SANDBOX_URL);
|
|
40
42
|
if (countryCode) {
|
|
41
43
|
newUrl.pathname = "/".concat(countryCode.toLowerCase());
|
|
42
44
|
}
|
package/build/utils/error.d.ts
CHANGED
package/build/utils/error.js
CHANGED
|
@@ -4,3 +4,6 @@ export var isNetworkError = function (error) {
|
|
|
4
4
|
export var isTokenExpired = function (error) {
|
|
5
5
|
return ['token expired'].includes((error || '').trim().toLowerCase());
|
|
6
6
|
};
|
|
7
|
+
export var isTimeoutError = function (error) {
|
|
8
|
+
return (error || '').trim().toLowerCase().includes('timeout');
|
|
9
|
+
};
|
package/build/utils/string.d.ts
CHANGED
|
@@ -75,6 +75,6 @@ export declare const getFileType: (type: string) => "" | "image/jpeg" | "image/p
|
|
|
75
75
|
export declare const isStringHasOneAsterisk: (value: string) => boolean;
|
|
76
76
|
export declare const isOtherLicense: (item?: License) => boolean;
|
|
77
77
|
export declare const formatNumberAsCurrency: (number: string) => string;
|
|
78
|
-
export declare const getCurrencyByCountryIso2: (countryCode
|
|
78
|
+
export declare const getCurrencyByCountryIso2: (countryCode?: string) => string;
|
|
79
79
|
export declare const getMobileNumberLen: (initialLen: number, number: string) => number;
|
|
80
80
|
export declare const getWebsiteLink: (isAr: boolean, countryCode: string, path: string) => string;
|