@tap-payments/auth-jsconnect 2.1.35-test → 2.1.37-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/build/@types/app.d.ts +1 -0
- package/build/@types/app.js +1 -0
- package/build/api/brand.d.ts +1 -0
- package/build/api/brand.js +9 -1
- package/build/api/index.d.ts +2 -0
- package/build/api/lead.d.ts +1 -0
- package/build/api/lead.js +7 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +7 -5
- package/build/app/settings.js +15 -6
- package/build/app/store.d.ts +2 -0
- package/build/components/Button/Button.js +1 -5
- package/build/components/Radio/Radio.js +1 -1
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/app.d.ts +14 -0
- package/build/constants/app.js +45 -0
- package/build/features/app/auth/authStore.js +2 -10
- package/build/features/app/bank/bankStore.d.ts +1 -5
- package/build/features/app/bank/bankStore.js +3 -3
- package/build/features/app/brand/brandStore.js +3 -3
- package/build/features/app/business/businessStore.js +6 -16
- package/build/features/app/connect/connectStore.js +1 -8
- package/build/features/app/connectExpress/connectExpressStore.d.ts +39 -0
- package/build/features/app/connectExpress/connectExpressStore.js +171 -0
- package/build/features/app/entity/entityStore.js +3 -3
- package/build/features/app/individual/individualStore.d.ts +2 -10
- package/build/features/app/individual/individualStore.js +6 -8
- package/build/features/app/password/passwordStore.d.ts +2 -10
- package/build/features/app/password/passwordStore.js +5 -5
- package/build/features/app/tax/taxStore.js +3 -3
- package/build/features/auth/screens/NID/TAC.js +1 -3
- package/build/features/bank/screens/BankDetails/validation.js +6 -26
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +9 -15
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -2
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +1 -2
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +1 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -3
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -3
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -3
- package/build/features/brand/screens/BrandInfo/Segments.js +6 -15
- package/build/features/brand/screens/BrandInfo/TeamSize.js +6 -15
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseType.js +1 -5
- package/build/features/business/screens/BusinessType/validation.js +2 -6
- package/build/features/business/screens/Customers/CustomerLocations.js +1 -2
- package/build/features/business/screens/Customers/ExpectedCustomers.js +1 -2
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +1 -3
- package/build/features/business/screens/Customers/RefundPolicy.js +1 -3
- package/build/features/business/screens/Customers/TransactionPolicy.js +1 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/connect/screens/Individual/validation.js +2 -8
- package/build/features/connect/screens/Merchant/TAC.js +1 -3
- package/build/features/connectExpress/ConnectExpress.d.ts +10 -0
- package/build/features/connectExpress/ConnectExpress.js +134 -0
- package/build/features/connectExpress/index.d.ts +1 -0
- package/build/features/connectExpress/index.js +1 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connectExpress/screens/CivilID/CivilID.js +102 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connectExpress/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connectExpress/screens/CivilID/index.d.ts +3 -0
- package/build/features/connectExpress/screens/CivilID/index.js +2 -0
- package/build/features/connectExpress/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/CivilID/validation.js +4 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.d.ts +5 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +133 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.d.ts +12 -0
- package/build/features/connectExpress/screens/Mobile/MobileNumber.js +154 -0
- package/build/features/connectExpress/screens/Mobile/Title.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/Title.js +29 -0
- package/build/features/connectExpress/screens/Mobile/index.d.ts +3 -0
- package/build/features/connectExpress/screens/Mobile/index.js +2 -0
- package/build/features/connectExpress/screens/Mobile/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/Mobile/validation.js +28 -0
- package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/DOB.js +47 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/IDNumber.js +60 -0
- package/build/features/connectExpress/screens/NID/NID.d.ts +5 -0
- package/build/features/connectExpress/screens/NID/NID.js +94 -0
- package/build/features/connectExpress/screens/NID/index.d.ts +3 -0
- package/build/features/connectExpress/screens/NID/index.js +2 -0
- package/build/features/connectExpress/screens/NID/validation.d.ts +11 -0
- package/build/features/connectExpress/screens/NID/validation.js +9 -0
- package/build/features/connectExpress/screens/OTP/OTP.d.ts +5 -0
- package/build/features/connectExpress/screens/OTP/OTP.js +94 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/OTP/OTPInput.js +54 -0
- package/build/features/connectExpress/screens/OTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OTP/index.js +2 -0
- package/build/features/connectExpress/screens/OTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/OTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyPACI/VerifyPACI.js +95 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/screens/EntityCapital/ActivityList.js +1 -1
- package/build/features/entity/screens/EntityCapital/validation.js +2 -6
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +27 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +1 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -6
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/features/shared/Background/Background.js +1 -5
- package/build/features/shared/Button/Button.js +1 -3
- package/build/features/shared/Footer/Footer.js +1 -1
- package/build/features/shared/UploadMultipleFile/index.d.ts +0 -0
- package/build/features/shared/UploadMultipleFile/index.js +1 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +1 -3
- package/build/hooks/useAppConfig.d.ts +2 -1
- package/build/hooks/useAppConfig.js +2 -2
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/hooks/useSetFromDefaultValues.js +2 -2
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -1
- package/build/utils/array.js +1 -3
- package/build/utils/common.d.ts +1 -1
- package/build/utils/common.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
|
+
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var NIDValidationSchema = yup.object().shape({
|
|
3
|
+
dob: yup.string().min(5).required('enter_valid_birth_date'),
|
|
4
|
+
nid: yup
|
|
5
|
+
.string()
|
|
6
|
+
.matches(/^(1|2)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
|
|
7
|
+
.min(10, 'signup_invalid_national_id')
|
|
8
|
+
.required('signup_invalid_national_id')
|
|
9
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import Box from '@mui/material/Box/Box';
|
|
25
|
+
import { styled } from '@mui/material/styles';
|
|
26
|
+
import * as React from 'react';
|
|
27
|
+
import { useTranslation } from 'react-i18next';
|
|
28
|
+
import Text from '../../../../components/Text';
|
|
29
|
+
import { clearError, connectSelector, resetOTPScreen, verifyAuth } from '../../../app/connect/connectStore';
|
|
30
|
+
import Button from '../../../shared/Button';
|
|
31
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
32
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
33
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
34
|
+
import { useLanguage } from '../../../../hooks';
|
|
35
|
+
import { AuthForType } from '../../../../@types';
|
|
36
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
37
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
38
|
+
import Form from '../../../../components/Form';
|
|
39
|
+
import { maskPhone, maskID } from '../../../../utils';
|
|
40
|
+
import { OTPValidation } from './validation';
|
|
41
|
+
import OTPInput from './OTPInput';
|
|
42
|
+
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
43
|
+
var theme = _a.theme;
|
|
44
|
+
return ({
|
|
45
|
+
background: theme.palette.common.white,
|
|
46
|
+
border: '1px solid',
|
|
47
|
+
borderColor: theme.palette.divider,
|
|
48
|
+
direction: theme.direction,
|
|
49
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
50
|
+
marginBottom: theme.spacing(5.75)
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
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' }));
|
|
56
|
+
});
|
|
57
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flexDirection: 'column'
|
|
60
|
+
}); });
|
|
61
|
+
var OTP = function () {
|
|
62
|
+
var _a;
|
|
63
|
+
var dispatch = useAppDispatch();
|
|
64
|
+
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
65
|
+
var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
66
|
+
var methods = useForm({
|
|
67
|
+
resolver: yupResolver(OTPValidation),
|
|
68
|
+
defaultValues: defaultValues,
|
|
69
|
+
mode: 'onChange'
|
|
70
|
+
});
|
|
71
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
72
|
+
var t = useTranslation().t;
|
|
73
|
+
var isAr = useLanguage().isAr;
|
|
74
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
75
|
+
React.useEffect(function () {
|
|
76
|
+
if (error)
|
|
77
|
+
dispatch(clearError());
|
|
78
|
+
return function () {
|
|
79
|
+
dispatch(resetOTPScreen());
|
|
80
|
+
};
|
|
81
|
+
}, [methods.formState.isValid]);
|
|
82
|
+
var onSubmit = function (formData) {
|
|
83
|
+
dispatch(verifyAuth(formData));
|
|
84
|
+
};
|
|
85
|
+
var onBack = function () {
|
|
86
|
+
dispatch(handlePrevScreenStep(startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
|
|
87
|
+
};
|
|
88
|
+
var disabled = !methods.formState.isValid || !!error;
|
|
89
|
+
var phone = ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + (data.mobileData.mobile || '');
|
|
90
|
+
var idNumber = data.nidData.nid;
|
|
91
|
+
var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
|
|
92
|
+
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') : title, !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: startWithNID ? maskID(idNumber) : maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
93
|
+
};
|
|
94
|
+
export default React.memo(OTP);
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { AuthForType } from '../../../../@types';
|
|
21
|
+
import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
|
|
22
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
|
+
var BoxStyled = styled(Box)(function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
fontFamily: theme.typography.fontFamily
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
var OTPInput = function (_a) {
|
|
32
|
+
var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
|
|
33
|
+
var t = useTranslation().t;
|
|
34
|
+
var dispatch = useAppDispatch();
|
|
35
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
36
|
+
var data = useAppSelector(connectSelector).data;
|
|
37
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
38
|
+
var handleOnOTPChange = function (otp) {
|
|
39
|
+
otpControl.field.onChange(otp);
|
|
40
|
+
};
|
|
41
|
+
var handleOnResendOTP = function () {
|
|
42
|
+
if (otpControl.field.value)
|
|
43
|
+
setValue('otp', '', { shouldValidate: true });
|
|
44
|
+
dispatch(resendOTPMobile());
|
|
45
|
+
};
|
|
46
|
+
var handleOnResendAbsherOTP = function () {
|
|
47
|
+
if (otpControl.field.value)
|
|
48
|
+
setValue('otp', '', { shouldValidate: true });
|
|
49
|
+
dispatch(resendOTPNID());
|
|
50
|
+
};
|
|
51
|
+
var otpValue = otpControl.field.value;
|
|
52
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: startWithNID ? handleOnResendAbsherOTP : handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
53
|
+
};
|
|
54
|
+
export default React.memo(OTPInput);
|
|
@@ -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
|
+
}>>>;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 Box from '@mui/material/Box/Box';
|
|
15
|
+
import { styled } from '@mui/material/styles';
|
|
16
|
+
import Text from '../../../../components/Text';
|
|
17
|
+
import { connectSelector, verifyPACI as verifyPACIFun } from '../../../app/connect/connectStore';
|
|
18
|
+
import PaciVerification from '../../../shared/PaciVerification';
|
|
19
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
var VerifyPACITitleContainerStyled = styled(Box)(function (_a) {
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return ({
|
|
24
|
+
direction: theme.direction,
|
|
25
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
marginBottom: theme.spacing(2.5)
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var VerifyPACITitleStyled = styled(Text)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
35
|
+
});
|
|
36
|
+
var VerifyPACISubTitleStyled = styled(Text)(function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line', textAlign: 'center' }));
|
|
39
|
+
});
|
|
40
|
+
var Container = styled(Box)(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return ({
|
|
43
|
+
position: 'relative',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
maxHeight: '300px'
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var BackButton = styled('button')(function (_a) {
|
|
51
|
+
var theme = _a.theme;
|
|
52
|
+
return ({
|
|
53
|
+
cursor: 'pointer',
|
|
54
|
+
pointerEvents: 'auto',
|
|
55
|
+
height: 44,
|
|
56
|
+
appearance: 'none',
|
|
57
|
+
background: 'none',
|
|
58
|
+
border: 'none',
|
|
59
|
+
color: theme.palette.primary.main,
|
|
60
|
+
fontSize: theme.typography.body1.fontSize,
|
|
61
|
+
fontWeight: theme.typography.fontWeightMedium,
|
|
62
|
+
textTransform: 'capitalize',
|
|
63
|
+
'&:hover': {
|
|
64
|
+
backgroundColor: 'transparent'
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
var VerifyPACI = function () {
|
|
69
|
+
var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
|
|
70
|
+
var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
|
|
71
|
+
var dispatch = useAppDispatch();
|
|
72
|
+
var data = useAppSelector(connectSelector).data;
|
|
73
|
+
var responseBody = data.civilIdData.responseBody;
|
|
74
|
+
var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios;
|
|
75
|
+
React.useEffect(function () {
|
|
76
|
+
if (responseBody && !isReady) {
|
|
77
|
+
setIsReady(true);
|
|
78
|
+
}
|
|
79
|
+
}, [responseBody]);
|
|
80
|
+
React.useEffect(function () {
|
|
81
|
+
if (!isReady)
|
|
82
|
+
return;
|
|
83
|
+
var promise = dispatch(verifyPACIFun({ onSuccess: function () { return setSuccess(true); } }));
|
|
84
|
+
return function () {
|
|
85
|
+
promise === null || promise === void 0 ? void 0 : promise.abort();
|
|
86
|
+
};
|
|
87
|
+
}, [isReady]);
|
|
88
|
+
var onBack = React.useCallback(function () {
|
|
89
|
+
dispatch(handlePrevScreenStep());
|
|
90
|
+
}, []);
|
|
91
|
+
if (!isReady)
|
|
92
|
+
return null;
|
|
93
|
+
return (_jsx(PaciVerification, { expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
|
|
94
|
+
};
|
|
95
|
+
export default React.memo(VerifyPACI);
|
|
@@ -167,7 +167,7 @@ var ActivitiesList = function (_a) {
|
|
|
167
167
|
var getSelectedActivityFlag = function (item) {
|
|
168
168
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
169
169
|
};
|
|
170
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t(isCR ? 'activities' : 'category') }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, disabled: disabled, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.
|
|
170
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t(isCR ? 'activities' : 'category') }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, disabled: disabled, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: isAr ? 'name.ar' : 'name.en', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
171
171
|
var _a, _b, _c;
|
|
172
172
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: isAr ? (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
173
173
|
} }) }))] })] }));
|
|
@@ -15,11 +15,7 @@ export var EntityCapitalValidationSchema = function (entity) {
|
|
|
15
15
|
en: yup.string()
|
|
16
16
|
})),
|
|
17
17
|
capitalPaid: isCapitalPaidOptional ? yup.string().optional() : yup.string().required('capital_paid_required'),
|
|
18
|
-
capitalShareCount: isCapitalShareCountOptional
|
|
19
|
-
|
|
20
|
-
: yup.string().required('capital_share_count_required'),
|
|
21
|
-
capitalShareValue: isCapitalShareValueOptional
|
|
22
|
-
? yup.string().optional()
|
|
23
|
-
: yup.string().required('capital_share_value_required')
|
|
18
|
+
capitalShareCount: isCapitalShareCountOptional ? yup.string().optional() : yup.string().required('capital_share_count_required'),
|
|
19
|
+
capitalShareValue: isCapitalShareValueOptional ? yup.string().optional() : yup.string().required('capital_share_value_required')
|
|
24
20
|
});
|
|
25
21
|
};
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, entity = _g.entity, brand = _g.brand, bank = _g.bank, merchant = _g.merchant, vatID = _g.vatID, user = _g.user, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = (user === null || user === void 0 ? void 0 : user.names) || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FeatureScreenStep } from '../@types';
|
|
2
2
|
export declare const connectFeatureScreens: Array<FeatureScreenStep>;
|
|
3
|
+
export declare const connectExpressFeatureScreens: Array<FeatureScreenStep>;
|
|
3
4
|
export declare const businessFeatureScreens: Array<FeatureScreenStep>;
|
|
4
5
|
export declare const passwordFeatureScreens: Array<FeatureScreenStep>;
|
|
5
6
|
export declare const individualFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -6,6 +6,11 @@ import IndividualScreen from './connect/screens/Individual';
|
|
|
6
6
|
import MerchantInfoScreen from './connect/screens/Merchant';
|
|
7
7
|
import ConnectOTPScreen from './connect/screens/OTP';
|
|
8
8
|
import ThankYouScreen from './connect/screens/ThankYou';
|
|
9
|
+
import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
|
|
10
|
+
import ConnectExpressNIDScreen from './connectExpress/screens/NID';
|
|
11
|
+
import ConnectExpressCivilIDScreen from './connectExpress/screens/CivilID';
|
|
12
|
+
import ConnectExpressVerifyPACIScreen from './connectExpress/screens/VerifyPACI';
|
|
13
|
+
import ConnectExpressOTPScreen from './connectExpress/screens/OTP';
|
|
9
14
|
import CustomersPage from './business/screens/Customers';
|
|
10
15
|
import IDBODPage from './business/screens/IDBOD';
|
|
11
16
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
@@ -90,6 +95,28 @@ export var connectFeatureScreens = [
|
|
|
90
95
|
element: ThankYouScreen
|
|
91
96
|
}
|
|
92
97
|
];
|
|
98
|
+
export var connectExpressFeatureScreens = [
|
|
99
|
+
{
|
|
100
|
+
name: 'CONNECT_EXPRESS_NID_STEP',
|
|
101
|
+
element: ConnectExpressNIDScreen
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: 'CONNECT_EXPRESS_CIVIL_ID_STEP',
|
|
105
|
+
element: ConnectExpressCivilIDScreen
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'CONNECT_EXPRESS_MOBILE_STEP',
|
|
109
|
+
element: ConnectExpressMobileScreen
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'CONNECT_EXPRESS_OTP_STEP',
|
|
113
|
+
element: ConnectExpressOTPScreen
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
|
|
117
|
+
element: ConnectExpressVerifyPACIScreen
|
|
118
|
+
}
|
|
119
|
+
];
|
|
93
120
|
export var businessFeatureScreens = [
|
|
94
121
|
{
|
|
95
122
|
name: 'BUSINESS_VERIFY_STEP',
|
package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js
CHANGED
|
@@ -76,10 +76,7 @@ var AdditionalIndividualInfo = function (_a) {
|
|
|
76
76
|
var isEmployerLocationListActive = listActive === ListType.EmployerLocationList;
|
|
77
77
|
var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
|
|
78
78
|
var isOccupationListActive = listActive === ListType.OccupationList;
|
|
79
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive &&
|
|
80
|
-
employerFieldsActive &&
|
|
81
|
-
!isMonthlyIncomeListActive &&
|
|
82
|
-
!isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, {}), _jsx(SignatureFile, { show: user === null || user === void 0 ? void 0 : user.is_authorized })] })), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
79
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive && employerFieldsActive && !isMonthlyIncomeListActive && !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, {}), _jsx(SignatureFile, { show: user === null || user === void 0 ? void 0 : user.is_authorized })] })), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
83
80
|
};
|
|
84
81
|
export default React.memo(AdditionalIndividualInfo);
|
|
85
82
|
AdditionalIndividualInfo.defaultProps = {};
|
|
@@ -83,8 +83,7 @@ var Occupation = function (_a) {
|
|
|
83
83
|
};
|
|
84
84
|
var handleSearch = function (value) {
|
|
85
85
|
var filteredList = occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.filter(function (occupation) {
|
|
86
|
-
return occupation.name.en.toLowerCase().includes(value.toLowerCase()) ||
|
|
87
|
-
occupation.name.ar.toLowerCase().includes(value.toLowerCase());
|
|
86
|
+
return occupation.name.en.toLowerCase().includes(value.toLowerCase()) || occupation.name.ar.toLowerCase().includes(value.toLowerCase());
|
|
88
87
|
});
|
|
89
88
|
setOccupationList(filteredList);
|
|
90
89
|
};
|
|
@@ -26,9 +26,7 @@ export var IndividualInfoValidationSchema = yup.object().shape({
|
|
|
26
26
|
.test({
|
|
27
27
|
test: function (value) {
|
|
28
28
|
if (!!value)
|
|
29
|
-
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE
|
|
30
|
-
? true
|
|
31
|
-
: this.createError({ message: 'alert_file_upload' });
|
|
29
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
32
30
|
return true;
|
|
33
31
|
}
|
|
34
32
|
})
|
|
@@ -39,9 +37,7 @@ export var IndividualInfoValidationSchema = yup.object().shape({
|
|
|
39
37
|
.test({
|
|
40
38
|
test: function (value) {
|
|
41
39
|
if (!!value)
|
|
42
|
-
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE
|
|
43
|
-
? true
|
|
44
|
-
: this.createError({ message: 'alert_file_upload' });
|
|
40
|
+
return VALID_FILE_FORMATS.includes(value === null || value === void 0 ? void 0 : value.type) && (value === null || value === void 0 ? void 0 : value.size) < MAX_FILE_SIZE ? true : this.createError({ message: 'alert_file_upload' });
|
|
45
41
|
return true;
|
|
46
42
|
}
|
|
47
43
|
})
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, nameObj = _g.name, entity = _g.entity, brand = _g.brand, bank = _g.bank_account, merchant = _g.merchant, user = _g.user, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, nameObj = _g.name, entity = _g.entity, brand = _g.brand, bank = _g.bank_account, merchant = _g.merchant, user = _g.user, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -25,11 +25,7 @@ var BackgroundStyled = styled(Box, {
|
|
|
25
25
|
height: '100vh',
|
|
26
26
|
zIndex: isSmall ? 'auto' : 999,
|
|
27
27
|
position: 'absolute',
|
|
28
|
-
background: !open
|
|
29
|
-
? 'inherit'
|
|
30
|
-
: isTapOrigin
|
|
31
|
-
? 'linear-gradient(180deg, #98ABAF 0%, #D9D6CC 100%)'
|
|
32
|
-
: 'rgba(0, 0, 0, 0.5)'
|
|
28
|
+
background: !open ? 'inherit' : isTapOrigin ? 'linear-gradient(180deg, #98ABAF 0%, #D9D6CC 100%)' : 'rgba(0, 0, 0, 0.5)'
|
|
33
29
|
});
|
|
34
30
|
});
|
|
35
31
|
var Background = function (_a) {
|
|
@@ -96,7 +96,5 @@ export default function CustomButton(_a) {
|
|
|
96
96
|
React.useEffect(function () {
|
|
97
97
|
setBtnLoading(false);
|
|
98
98
|
}, []);
|
|
99
|
-
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }, isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: btnLoading === false
|
|
100
|
-
? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW })
|
|
101
|
-
: undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!btnLoading })) }))] })] }));
|
|
99
|
+
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }, isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: btnLoading === false ? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) : undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!btnLoading })) }))] })] }));
|
|
102
100
|
}
|
|
@@ -16,5 +16,5 @@ export default function CustomFooter() {
|
|
|
16
16
|
var country = data.businessCountry;
|
|
17
17
|
var countryName = isEn ? country.name.english : country.name.arabic;
|
|
18
18
|
var countryFlag = country.logo;
|
|
19
|
-
return
|
|
19
|
+
return _jsx(Footer, { onSwitchLanguage: handleChangeLanguage, language: t('language'), countryName: countryName, countryFlag: countryFlag });
|
|
20
20
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -51,9 +51,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
51
51
|
var _g = data.verify.responseBody || {}, flows = _g.flows, nameObj = _g.name, entity = _g.entity, brand = _g.brand, bank = _g.bank, merchant = _g.merchant, vatID = _g.vatID, user = _g.user, business = _g.business;
|
|
52
52
|
var _h = useState([]), buttons = _h[0], setButtons = _h[1];
|
|
53
53
|
var _j = nameObj || {}, en = _j.en, ar = _j.ar;
|
|
54
|
-
var username = isAr
|
|
55
|
-
? concatenateObjectValues(ar || en, ['first', 'last'])
|
|
56
|
-
: concatenateObjectValues(en, ['first', 'last']);
|
|
54
|
+
var username = isAr ? concatenateObjectValues(ar || en, ['first', 'last']) : concatenateObjectValues(en, ['first', 'last']);
|
|
57
55
|
var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
58
56
|
var bankName = shortenString(bank === null || bank === void 0 ? void 0 : bank.bank_name, 20) || t('bank');
|
|
59
57
|
var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
|
|
@@ -3,6 +3,7 @@ interface AppConfigProps extends LibConfig {
|
|
|
3
3
|
navigation: ScreenStepNavigation[];
|
|
4
4
|
disableCountries?: boolean;
|
|
5
5
|
disableLocale?: boolean;
|
|
6
|
+
prepare?: () => Promise<void>;
|
|
6
7
|
}
|
|
7
|
-
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, ...rest }: AppConfigProps) => void;
|
|
8
|
+
export declare const useAppConfig: ({ appInfo, navigation, publicKey, disableCountries, disableLocale, prepare, ...rest }: AppConfigProps) => void;
|
|
8
9
|
export {};
|
|
@@ -27,7 +27,7 @@ import { axiosInstance } from '../api';
|
|
|
27
27
|
import { isTapDomain, removeRequestHeaders } from '../utils';
|
|
28
28
|
import { ENDPOINT_PATHS } from '../constants';
|
|
29
29
|
export var useAppConfig = function (_a) {
|
|
30
|
-
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale"]);
|
|
30
|
+
var appInfo = _a.appInfo, navigation = _a.navigation, publicKey = _a.publicKey, disableCountries = _a.disableCountries, disableLocale = _a.disableLocale, prepare = _a.prepare, rest = __rest(_a, ["appInfo", "navigation", "publicKey", "disableCountries", "disableLocale", "prepare"]);
|
|
31
31
|
var dispatch = useAppDispatch();
|
|
32
32
|
var setBaseUrl = function () {
|
|
33
33
|
var isProd = publicKey.includes('pk_live');
|
|
@@ -56,6 +56,6 @@ export var useAppConfig = function (_a) {
|
|
|
56
56
|
setBaseUrl();
|
|
57
57
|
setAppConfig();
|
|
58
58
|
dispatch(handleLanguage(rest.language));
|
|
59
|
-
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale, mdn: rest.merchantDomain }));
|
|
59
|
+
dispatch(fetchAppSettingsSync({ disableCountries: disableCountries, disableLocale: disableLocale, mdn: rest.merchantDomain, prepare: prepare }));
|
|
60
60
|
}, []);
|
|
61
61
|
};
|
|
@@ -10,4 +10,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
10
10
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
11
11
|
auth: import("../features/app/auth/authStore").AuthState;
|
|
12
12
|
brand: import("../features/app/brand/brandStore").BrandState;
|
|
13
|
+
connectExpress: import("../features/app/connectExpress/connectExpressStore").ConnectExpressState;
|
|
13
14
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
|
@@ -2,8 +2,8 @@ import { useEffect } from 'react';
|
|
|
2
2
|
var isValidValue = function (value) {
|
|
3
3
|
if (Array.isArray(value))
|
|
4
4
|
return value.length > 0;
|
|
5
|
-
if (typeof value === 'object')
|
|
6
|
-
return Object.keys(value).length > 0;
|
|
5
|
+
if (typeof value === 'object' && !!value)
|
|
6
|
+
return (Object === null || Object === void 0 ? void 0 : Object.keys(value).length) > 0;
|
|
7
7
|
return value !== undefined && value !== null && value !== '';
|
|
8
8
|
};
|
|
9
9
|
export var useSetFromDefaultValues = function (method, defaultValues, shouldValidate) {
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import './i18n';
|
|
3
3
|
import { ConnectLib, renderConnectLib, ConnectLibProps, unmountConnectLib } from './features/connect';
|
|
4
|
+
import { ConnectExpressLib, renderConnectExpressLib, ConnectExpressLibProps, unmountConnectExpressLib } from './features/connectExpress';
|
|
4
5
|
import { BusinessLib, renderBusinessLib, BusinessLibProps, unmountBusinessLib } from './features/business';
|
|
5
6
|
import { PasswordLib, renderPasswordLib, PasswordLibProps, unmountPasswordLib } from './features/password';
|
|
6
7
|
import { IndividualLib, renderIndividualLib, IndividualLibProps, unmountIndividualLib } from './features/individual';
|
|
@@ -10,5 +11,5 @@ import { SignInLib, renderSignInLib, SignInLibProps, unmountSignInLib } from './
|
|
|
10
11
|
import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
12
|
import { BrandLib, BrandLibProps, renderBrandLib, unmountBrandLib } from './features/brand';
|
|
12
13
|
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
-
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, BrandLibProps, AuthLibProps, SignInLibProps };
|
|
14
|
-
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, BrandLib, unmountBrandLib, renderBrandLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|
|
14
|
+
export type { ConnectLibProps, ConnectExpressLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, BrandLibProps, AuthLibProps, SignInLibProps };
|
|
15
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, ConnectExpressLib, renderConnectExpressLib, unmountConnectExpressLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, BrandLib, unmountBrandLib, renderBrandLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|