@tap-payments/auth-jsconnect 2.8.73-development → 2.8.75-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/form.d.ts +1 -1
- package/build/api/auth.d.ts +0 -13
- package/build/api/index.d.ts +2 -2
- package/build/api/lead.d.ts +0 -6
- package/build/assets/locales/ar.json +1 -10
- package/build/assets/locales/en.json +1 -10
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/app.d.ts +2 -1
- package/build/constants/app.js +14 -35
- package/build/constants/assets.d.ts +0 -2
- package/build/constants/assets.js +0 -2
- package/build/features/app/auth/authStore.d.ts +15 -5
- package/build/features/app/auth/authStore.js +113 -58
- package/build/features/app/business/businessStore.d.ts +11 -16
- package/build/features/app/business/businessStore.js +44 -58
- package/build/features/app/connect/connectStore.d.ts +12 -19
- package/build/features/app/connect/connectStore.js +82 -151
- package/build/features/app/connectExpress/connectExpressStore.d.ts +33 -10
- package/build/features/app/connectExpress/connectExpressStore.js +251 -156
- package/build/features/app/individual/individualStore.js +2 -4
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
- package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/auth/screens/NID/DOB.d.ts +6 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.js +1 -1
- package/build/features/auth/screens/NID/NID.js +10 -4
- package/build/features/auth/screens/NID/validation.d.ts +3 -0
- package/build/features/auth/screens/NID/validation.js +1 -0
- package/build/features/auth/screens/OTP/OTP.js +5 -1
- package/build/features/auth/screens/OTP/OTPInput.js +13 -2
- package/build/features/business/screens/BusinessType/LicenseNumber.js +2 -2
- package/build/features/business/screens/OTP/OTP.d.ts +8 -0
- package/build/features/business/screens/OTP/OTP.js +90 -0
- package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/business/screens/OTP/OTPInput.js +49 -0
- package/build/features/business/screens/OTP/index.d.ts +3 -0
- package/build/features/business/screens/OTP/index.js +2 -0
- package/build/features/business/screens/OTP/validation.d.ts +8 -0
- package/build/features/business/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Mobile/Mobile.js +2 -2
- package/build/features/connect/screens/NID/DOB.d.ts +5 -0
- package/build/features/connect/screens/NID/DOB.js +47 -0
- package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connect/screens/NID/IDNumber.js +2 -2
- package/build/features/connect/screens/NID/NID.js +11 -5
- package/build/features/connect/screens/NID/validation.d.ts +3 -0
- package/build/features/connect/screens/NID/validation.js +1 -0
- package/build/features/connect/screens/OTP/OTPInput.js +11 -3
- package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
- package/build/features/{auth/screens/VerifyNafath/VerifyNafath.d.ts → connectExpress/screens/IdentityOTP/OTP.d.ts} +2 -2
- package/build/features/connectExpress/screens/IdentityOTP/OTP.js +88 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +56 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/IdentityOTP/index.js +2 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
- package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
- package/build/features/connectExpress/screens/NID/DOB.js +47 -0
- package/build/features/connectExpress/screens/NID/IDNumber.d.ts +0 -1
- package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
- package/build/features/connectExpress/screens/NID/NID.js +9 -4
- package/build/features/connectExpress/screens/NID/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/NID/validation.js +2 -0
- package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
- package/build/features/connectExpress/screens/OTP/OTP.js +13 -5
- package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -3
- package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
- package/build/features/featuresScreens.js +6 -21
- package/build/features/shared/Button/AbsherButton.d.ts +7 -0
- package/build/features/shared/Button/{NafathButton.js → AbsherButton.js} +3 -13
- package/build/features/shared/Button/index.d.ts +2 -2
- package/build/features/shared/Button/index.js +2 -2
- package/build/theme/palette.js +1 -2
- package/build/utils/common.js +4 -4
- package/build/utils/validation.d.ts +1 -0
- package/build/utils/validation.js +3 -0
- package/package.json +2 -2
- package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/auth/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/auth/screens/VerifyNafath/index.js +0 -2
- package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/business/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/business/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/business/screens/VerifyNafath/index.js +0 -2
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connect/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connect/screens/VerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +0 -2
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +0 -34
- package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +0 -3
- package/build/features/connectExpress/screens/VerifyNafath/index.js +0 -2
- package/build/features/shared/Button/NafathButton.d.ts +0 -7
- package/build/features/shared/NafathVerification/NafathVerification.d.ts +0 -13
- package/build/features/shared/NafathVerification/NafathVerification.js +0 -92
- package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +0 -8
- package/build/features/shared/NafathVerification/VerifyNafathLoading.js +0 -53
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +0 -5
- package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +0 -8
- package/build/features/shared/NafathVerification/index.d.ts +0 -2
- package/build/features/shared/NafathVerification/index.js +0 -2
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useController, useFormContext } from 'react-hook-form';
|
|
5
5
|
import { KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH, LICENSE_NUMBER_MAX_LENGTH, LICENSE_NUMBER_MIN_LENGTH } from '../../../../constants';
|
|
6
|
-
import {
|
|
6
|
+
import { isSA, cleanFLandCRNumber } from '../../../../utils';
|
|
7
7
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
8
8
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
9
9
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -19,7 +19,7 @@ var LicenseNumber = function () {
|
|
|
19
19
|
var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
|
|
20
20
|
var handleFLNumberChange = function (_a) {
|
|
21
21
|
var target = _a.target;
|
|
22
|
-
var value =
|
|
22
|
+
var value = cleanFLandCRNumber(target.value);
|
|
23
23
|
licenseNumberControl.field.onChange(value);
|
|
24
24
|
};
|
|
25
25
|
var clearLicenseNumber = function () {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
18
|
+
import { clearError, authSelector } from '../../../app/auth/authStore';
|
|
19
|
+
import Text from '../../../../components/Text';
|
|
20
|
+
import Calender from '../../../shared/Calender';
|
|
21
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
24
|
+
});
|
|
25
|
+
var DOB = function (_a) {
|
|
26
|
+
var _b;
|
|
27
|
+
var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly;
|
|
28
|
+
var t = useTranslation().t;
|
|
29
|
+
var control = useFormContext().control;
|
|
30
|
+
var dispatch = useAppDispatch();
|
|
31
|
+
var dobControl = useController({ control: control, name: 'dob' });
|
|
32
|
+
var error = useAppSelector(authSelector).error;
|
|
33
|
+
var handleBirthDateChange = function (data) {
|
|
34
|
+
dobControl.field.onChange(data);
|
|
35
|
+
handleClearError();
|
|
36
|
+
};
|
|
37
|
+
var handleClearError = function () {
|
|
38
|
+
if (error)
|
|
39
|
+
dispatch(clearError());
|
|
40
|
+
};
|
|
41
|
+
var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
42
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
43
|
+
var spacing = _a.spacing;
|
|
44
|
+
return spacing(2.5, 2.5, 1.5, 2.5);
|
|
45
|
+
} } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true, disabled: readOnly, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleBirthDateChange })] }));
|
|
46
|
+
};
|
|
47
|
+
export default DOB;
|
|
@@ -50,6 +50,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
50
50
|
};
|
|
51
51
|
var nidValue = nidControl.field.value;
|
|
52
52
|
var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
53
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref
|
|
53
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { readOnly: readOnly, dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: _jsx(EndAdornment, { value: nidValue, error: error, onClear: clearIdNumber }), placeholder: t('national_id_placeholder'), warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
|
|
54
54
|
});
|
|
55
55
|
export default React.memo(IDNumber);
|
|
@@ -17,22 +17,25 @@ import { styled } from '@mui/material/styles';
|
|
|
17
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
18
|
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
|
-
import { clearError, authSelector,
|
|
20
|
+
import { clearError, authSelector, createNIDAuth } from '../../../app/auth/authStore';
|
|
21
21
|
import Form from '../../../../components/Form';
|
|
22
22
|
import Button from '../../../shared/Button';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
|
+
import Collapse from '../../../../components/Collapse';
|
|
24
25
|
import { deepCopy } from '../../../../utils';
|
|
25
26
|
import IDNumber from './IDNumber';
|
|
27
|
+
import DOB from './DOB';
|
|
26
28
|
import { NIDValidationSchema } from './validation';
|
|
27
29
|
var FormStyled = styled(Form)(function () { return ({
|
|
28
30
|
display: 'flex',
|
|
29
31
|
flexDirection: 'column'
|
|
30
32
|
}); });
|
|
31
33
|
var NID = function (_a) {
|
|
34
|
+
var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
|
|
32
35
|
var isAr = useLanguage().isAr;
|
|
33
36
|
var dispatch = useAppDispatch();
|
|
34
37
|
var t = useTranslation().t;
|
|
35
|
-
var
|
|
38
|
+
var _c = useAppSelector(authSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
36
39
|
var methods = useForm({
|
|
37
40
|
resolver: yupResolver(NIDValidationSchema()),
|
|
38
41
|
defaultValues: data.nidData,
|
|
@@ -45,12 +48,15 @@ var NID = function (_a) {
|
|
|
45
48
|
React.useEffect(function () {
|
|
46
49
|
}, []);
|
|
47
50
|
var onSubmit = function (data) {
|
|
48
|
-
dispatch(
|
|
51
|
+
dispatch(createNIDAuth(deepCopy(data)));
|
|
52
|
+
};
|
|
53
|
+
var handleCollapseOpenClose = function (flag) {
|
|
54
|
+
setCollapse(flag);
|
|
49
55
|
};
|
|
50
56
|
var onBack = function () {
|
|
51
57
|
dispatch(handlePrevScreenStep());
|
|
52
58
|
};
|
|
53
59
|
var disabled = !methods.formState.isValid;
|
|
54
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { show:
|
|
60
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
55
61
|
};
|
|
56
62
|
export default React.memo(NID);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
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>;
|
|
3
4
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
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>;
|
|
5
7
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
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>;
|
|
7
10
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
11
|
}>>>;
|
|
@@ -16,7 +16,7 @@ import { useForm, FormProvider } from 'react-hook-form';
|
|
|
16
16
|
import Box from '@mui/material/Box/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import Text from '../../../../components/Text';
|
|
19
|
-
import { clearError, authSelector, verifyMobileOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
|
|
19
|
+
import { clearError, authSelector, verifyMobileOtp, verifyNIDOtp, resetOTPValue, verifyEmailOtp } from '../../../app/auth/authStore';
|
|
20
20
|
import Button from '../../../shared/Button';
|
|
21
21
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
22
22
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
@@ -99,6 +99,10 @@ var OTP = function () {
|
|
|
99
99
|
};
|
|
100
100
|
}, []);
|
|
101
101
|
var onSubmit = function (formData) {
|
|
102
|
+
if (isNidAuth) {
|
|
103
|
+
dispatch(verifyNIDOtp(deepCopy(formData)));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
102
106
|
if (isEmailAuth) {
|
|
103
107
|
dispatch(verifyEmailOtp(deepCopy(formData)));
|
|
104
108
|
return;
|
|
@@ -18,7 +18,7 @@ import { styled } from '@mui/material/styles';
|
|
|
18
18
|
import OTPField from '../../../shared/OTP';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
20
|
import { AuthForType } from '../../../../@types';
|
|
21
|
-
import { resendMobileAuthOTP, authSelector, clearError, resendEmailAuthOTP } from '../../../app/auth/authStore';
|
|
21
|
+
import { resendMobileAuthOTP, resendNIDAuthOTP, authSelector, clearError, resendEmailAuthOTP } from '../../../app/auth/authStore';
|
|
22
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
23
|
import { sendCustomEventToGTM } from '../../../../utils';
|
|
24
24
|
var BoxStyled = styled(Box)(function (_a) {
|
|
@@ -35,7 +35,8 @@ var OTPInput = function (_a) {
|
|
|
35
35
|
var dispatch = useAppDispatch();
|
|
36
36
|
var otpControl = useController({ name: 'otp', control: control });
|
|
37
37
|
var _c = useAppSelector(authSelector), data = _c.data, error = _c.error;
|
|
38
|
-
var mobileData = data.mobileData, emailData = data.emailData;
|
|
38
|
+
var mobileData = data.mobileData, nidData = data.nidData, emailData = data.emailData;
|
|
39
|
+
var isNidAuth = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
39
40
|
var isEmailAuth = data.otpData.authFor === AuthForType.EMAIL;
|
|
40
41
|
var handleOnOTPChange = function (otp) {
|
|
41
42
|
if (error)
|
|
@@ -55,6 +56,12 @@ var OTPInput = function (_a) {
|
|
|
55
56
|
sendEventAskAnotherOTP();
|
|
56
57
|
dispatch(resendMobileAuthOTP(mobileData));
|
|
57
58
|
};
|
|
59
|
+
var handleOnResendAbsherOTP = function () {
|
|
60
|
+
if (otpControl.field.value)
|
|
61
|
+
setValue('otp', '', { shouldValidate: true });
|
|
62
|
+
sendEventAskAnotherOTP();
|
|
63
|
+
dispatch(resendNIDAuthOTP(nidData));
|
|
64
|
+
};
|
|
58
65
|
var handleOnResendEmailOTP = function () {
|
|
59
66
|
if (otpControl.field.value)
|
|
60
67
|
setValue('otp', '', { shouldValidate: true });
|
|
@@ -62,6 +69,10 @@ var OTPInput = function (_a) {
|
|
|
62
69
|
dispatch(resendEmailAuthOTP(emailData));
|
|
63
70
|
};
|
|
64
71
|
var onResendClick = function () {
|
|
72
|
+
if (isNidAuth) {
|
|
73
|
+
handleOnResendAbsherOTP();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
65
76
|
if (isEmailAuth) {
|
|
66
77
|
handleOnResendEmailOTP();
|
|
67
78
|
return;
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { CR_MIN_LICENSE_LENGTH, CR_NUMBER_MAX_LENGTH, FL_MIN_LICENSE_LENGTH, FL_NUMBER_MAX_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
|
|
17
|
-
import {
|
|
17
|
+
import { isOtherLicense, isKW, isOtherThanKWOrSA, cleanFLandCRNumber } from '../../../../utils';
|
|
18
18
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
19
19
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
20
20
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -38,7 +38,7 @@ var LicenseNumber = function (_a) {
|
|
|
38
38
|
var readOnly = !isOtherLicense(selectedLicense) || (selectedEntityLicense && !isOtherLicense(selectedEntityLicense));
|
|
39
39
|
var handleFLNumberChange = function (_a) {
|
|
40
40
|
var target = _a.target;
|
|
41
|
-
var value =
|
|
41
|
+
var value = cleanFLandCRNumber(target.value);
|
|
42
42
|
licenseNumberControl.field.onChange(value);
|
|
43
43
|
};
|
|
44
44
|
var clearLicenseNumber = function () {
|
|
@@ -0,0 +1,90 @@
|
|
|
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 * as React from 'react';
|
|
25
|
+
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
26
|
+
import { useTranslation } from 'react-i18next';
|
|
27
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
28
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
29
|
+
import Box from '@mui/material/Box/Box';
|
|
30
|
+
import { styled } from '@mui/material/styles';
|
|
31
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
32
|
+
import { useLanguage } from '../../../../hooks';
|
|
33
|
+
import Form from '../../../../components/Form';
|
|
34
|
+
import Text from '../../../../components/Text';
|
|
35
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
36
|
+
import { businessSelector, clearError, resetOTPScreen, verifyLeadOTP } from '../../../app/business/businessStore';
|
|
37
|
+
import Button from '../../../shared/Button';
|
|
38
|
+
import { deepCopy, maskID } from '../../../../utils';
|
|
39
|
+
import { OTPValidation } from './validation';
|
|
40
|
+
import OTPInput from './OTPInput';
|
|
41
|
+
var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
42
|
+
var theme = _a.theme;
|
|
43
|
+
return ({
|
|
44
|
+
background: theme.palette.common.white,
|
|
45
|
+
border: '1px solid',
|
|
46
|
+
borderColor: theme.palette.divider,
|
|
47
|
+
direction: theme.direction,
|
|
48
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
49
|
+
marginBottom: theme.spacing(5.75)
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
53
|
+
var theme = _a.theme;
|
|
54
|
+
return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
|
|
55
|
+
});
|
|
56
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
57
|
+
display: 'flex',
|
|
58
|
+
flexDirection: 'column'
|
|
59
|
+
}); });
|
|
60
|
+
var OTP = function (_a) {
|
|
61
|
+
var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
62
|
+
var dispatch = useAppDispatch();
|
|
63
|
+
var _c = data.otpData, responseBody = _c.responseBody, defaultValues = __rest(_c, ["responseBody"]);
|
|
64
|
+
var methods = useForm({
|
|
65
|
+
resolver: yupResolver(OTPValidation),
|
|
66
|
+
defaultValues: defaultValues,
|
|
67
|
+
mode: 'onChange'
|
|
68
|
+
});
|
|
69
|
+
useSetFromDefaultValues(methods, defaultValues);
|
|
70
|
+
var t = useTranslation().t;
|
|
71
|
+
var isAr = useLanguage().isAr;
|
|
72
|
+
React.useEffect(function () {
|
|
73
|
+
if (error)
|
|
74
|
+
dispatch(clearError());
|
|
75
|
+
return function () {
|
|
76
|
+
dispatch(resetOTPScreen());
|
|
77
|
+
};
|
|
78
|
+
}, [methods.formState.isValid]);
|
|
79
|
+
var onSubmit = function (formData) {
|
|
80
|
+
dispatch(verifyLeadOTP(deepCopy(formData)));
|
|
81
|
+
};
|
|
82
|
+
var onBack = function () {
|
|
83
|
+
dispatch(handlePrevScreenStep());
|
|
84
|
+
};
|
|
85
|
+
var disabled = !methods.formState.isValid;
|
|
86
|
+
var idNumber = data.nidData.nid;
|
|
87
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
88
|
+
};
|
|
89
|
+
OTP.defaultProps = {};
|
|
90
|
+
export default React.memo(OTP);
|
|
@@ -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 { businessSelector, clearError, resendOTPLeadIdentity } from '../../../app/business/businessStore';
|
|
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 error = useAppSelector(businessSelector).error;
|
|
35
|
+
var otpControl = useController({ name: 'otp', control: control });
|
|
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(resendOTPLeadIdentity());
|
|
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,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
|
+
}>>>;
|
|
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
18
18
|
import { styled, alpha } from '@mui/material/styles';
|
|
19
19
|
import Collapse from '../../../../components/Collapse';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import Button, {
|
|
21
|
+
import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
|
|
22
22
|
import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
|
|
23
23
|
import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
@@ -132,6 +132,6 @@ var Mobile = function (_a) {
|
|
|
132
132
|
var disabled = !methods.formState.isValid;
|
|
133
133
|
var title = t('join_our_community');
|
|
134
134
|
var subTitle = t('ide_terms_and_conditions_description');
|
|
135
|
-
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid && !isOtherThanKWOrSACountry }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(
|
|
135
|
+
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid && !isOtherThanKWOrSACountry }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) }))] }));
|
|
136
136
|
};
|
|
137
137
|
export default React.memo(Mobile);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
import Calender from '../../../shared/Calender';
|
|
20
|
+
import { clearError, connectSelector } from '../../../app/connect/connectStore';
|
|
21
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
22
|
+
var theme = _a.theme;
|
|
23
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
24
|
+
});
|
|
25
|
+
var DOB = function (_a) {
|
|
26
|
+
var _b;
|
|
27
|
+
var onDateClicked = _a.onDateClicked;
|
|
28
|
+
var t = useTranslation().t;
|
|
29
|
+
var control = useFormContext().control;
|
|
30
|
+
var dispatch = useAppDispatch();
|
|
31
|
+
var dobControl = useController({ control: control, name: 'dob' });
|
|
32
|
+
var error = useAppSelector(connectSelector).error;
|
|
33
|
+
var handleBirthDateChange = function (data) {
|
|
34
|
+
dobControl.field.onChange(data);
|
|
35
|
+
handleClearError();
|
|
36
|
+
};
|
|
37
|
+
var handleClearError = function () {
|
|
38
|
+
if (error)
|
|
39
|
+
dispatch(clearError());
|
|
40
|
+
};
|
|
41
|
+
var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
42
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
43
|
+
var spacing = _a.spacing;
|
|
44
|
+
return spacing(2.5, 2.5, 1.5, 2.5);
|
|
45
|
+
} } }, { children: t('enter_birth_date') })), _jsx(Calender, { isDob: true, defaultValue: dateValue ? new Date(dateValue) : undefined, onDateClicked: onDateClicked, onDateChange: handleBirthDateChange })] }));
|
|
46
|
+
};
|
|
47
|
+
export default DOB;
|
|
@@ -36,7 +36,7 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
36
36
|
});
|
|
37
37
|
var IDNumber = React.forwardRef(function (_a, ref) {
|
|
38
38
|
var _b;
|
|
39
|
-
var show = _a.show
|
|
39
|
+
var show = _a.show;
|
|
40
40
|
var t = useTranslation().t;
|
|
41
41
|
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
42
42
|
var nidControl = useController({ control: control, name: 'nid' });
|
|
@@ -54,6 +54,6 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
54
54
|
};
|
|
55
55
|
var nidValue = nidControl.field.value;
|
|
56
56
|
var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
57
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref
|
|
57
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('enter_national_id') }) }), _jsx(Input, { dir: 'ltr', type: 'tel', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: _jsx(EndAdornment, { value: nidValue, error: error, onClear: clearIdNumber }), placeholder: t('national_id_placeholder'), warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true })] })) })));
|
|
58
58
|
});
|
|
59
59
|
export default React.memo(IDNumber);
|
|
@@ -18,7 +18,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
|
|
|
18
18
|
import { NIDValidationSchema } from './validation';
|
|
19
19
|
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
20
20
|
import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
|
-
import { clearError, connectSelector,
|
|
21
|
+
import { clearError, connectSelector, createNIDAuth, resetMobileScreen, resetStore } from '../../../app/connect/connectStore';
|
|
22
22
|
import Form from '../../../../components/Form';
|
|
23
23
|
import Button, { MobileButton } from '../../../shared/Button';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -28,6 +28,7 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import Divider from '@mui/material/Divider';
|
|
29
29
|
import Text from '../../../../components/Text';
|
|
30
30
|
import IDNumber from './IDNumber';
|
|
31
|
+
import DOB from './DOB';
|
|
31
32
|
var FormStyled = styled(Form)(function () { return ({
|
|
32
33
|
display: 'flex',
|
|
33
34
|
flexDirection: 'column'
|
|
@@ -57,15 +58,17 @@ var OrBoxStyled = styled(Box)(function (_a) {
|
|
|
57
58
|
});
|
|
58
59
|
});
|
|
59
60
|
var NID = function (_a) {
|
|
61
|
+
var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
|
|
60
62
|
var isAr = useLanguage().isAr;
|
|
61
63
|
var dispatch = useAppDispatch();
|
|
62
64
|
var t = useTranslation().t;
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
+
var _c = useAppSelector(connectSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
66
|
+
var _d = data.nidData, dob = _d.dob, nid = _d.nid;
|
|
65
67
|
var settingsStore = useAppSelector(settingsSelector);
|
|
66
68
|
var methods = useForm({
|
|
67
69
|
resolver: yupResolver(NIDValidationSchema),
|
|
68
70
|
defaultValues: {
|
|
71
|
+
dob: dob,
|
|
69
72
|
nid: nid
|
|
70
73
|
},
|
|
71
74
|
mode: 'onChange'
|
|
@@ -74,9 +77,12 @@ var NID = function (_a) {
|
|
|
74
77
|
handleClearError();
|
|
75
78
|
}, [methods.formState.isValid]);
|
|
76
79
|
var onSubmit = function (data) {
|
|
77
|
-
dispatch(
|
|
80
|
+
dispatch(createNIDAuth(deepCopy(data)));
|
|
78
81
|
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
79
82
|
};
|
|
83
|
+
var handleCollapseOpenClose = function (flag) {
|
|
84
|
+
setCollapse(flag);
|
|
85
|
+
};
|
|
80
86
|
var handleClearError = function () {
|
|
81
87
|
if (error)
|
|
82
88
|
dispatch(clearError());
|
|
@@ -96,6 +102,6 @@ var NID = function (_a) {
|
|
|
96
102
|
dispatch(resetStore());
|
|
97
103
|
}, []);
|
|
98
104
|
var disabled = !methods.formState.isValid;
|
|
99
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(
|
|
105
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled || settingsStore.loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading || settingsStore.loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
|
|
100
106
|
};
|
|
101
107
|
export default React.memo(NID);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
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>;
|
|
3
4
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
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>;
|
|
5
7
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
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>;
|
|
7
10
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
11
|
}>>>;
|