@tap-payments/auth-jsconnect 2.0.28-test → 2.0.28
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 +59 -20
- package/build/@types/app.js +16 -1
- package/build/@types/form.d.ts +21 -7
- package/build/api/auth.d.ts +24 -2
- package/build/api/auth.js +36 -1
- package/build/api/axios.js +2 -2
- package/build/api/brand.d.ts +2 -1
- package/build/api/brand.js +10 -1
- package/build/api/country.d.ts +3 -1
- package/build/api/country.js +3 -1
- package/build/api/data.d.ts +38 -7
- package/build/api/data.js +57 -17
- package/build/api/entity.d.ts +28 -5
- package/build/api/entity.js +23 -9
- package/build/api/firebase.d.ts +1 -1
- package/build/api/firebase.js +3 -1
- package/build/api/index.d.ts +41 -14
- package/build/api/individual.d.ts +76 -19
- package/build/api/individual.js +29 -2
- package/build/api/lead.d.ts +8 -6
- package/build/app/rootReducer.d.ts +2 -0
- package/build/app/rootReducer.js +5 -1
- package/build/app/settings.d.ts +8 -2
- package/build/app/settings.js +29 -12
- package/build/app/store.d.ts +5 -1
- package/build/assets/locales/ar.json +256 -179
- package/build/assets/locales/en.json +188 -104
- package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
- package/build/components/AnimationFlow/AnimationFlow.js +6 -8
- package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
- package/build/components/AnimationFlow/BottomSheet.js +4 -3
- package/build/components/AnimationFlow/Dialog.d.ts +5 -1
- package/build/components/AnimationFlow/Dialog.js +11 -5
- package/build/components/FileInput/DragAndDrop.d.ts +10 -1
- package/build/components/FileInput/DragAndDrop.js +107 -8
- package/build/components/Lottie/Lottie.d.ts +878 -0
- package/build/components/Lottie/Lottie.js +58 -0
- package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
- package/build/components/Lottie/files/success.json +425 -0
- package/build/components/Lottie/index.d.ts +3 -0
- package/build/components/Lottie/index.js +3 -0
- package/build/components/OTPField/OTPField.d.ts +2 -1
- package/build/components/OTPField/OTPField.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
- package/build/components/ProgressBar/CircularProgressBar.js +48 -0
- package/build/components/ProgressBar/index.d.ts +2 -0
- package/build/components/ProgressBar/index.js +2 -0
- package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
- package/build/components/RadioLabel/RadioLabel.js +2 -2
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -4
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
- package/build/constants/api.d.ts +6 -0
- package/build/constants/api.js +14 -1
- package/build/constants/app.d.ts +18 -0
- package/build/constants/app.js +98 -15
- package/build/constants/assets.d.ts +20 -1
- package/build/constants/assets.js +27 -8
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +2 -2
- package/build/constants/validation.d.ts +8 -0
- package/build/constants/validation.js +9 -1
- package/build/features/app/auth/authStore.d.ts +47 -0
- package/build/features/app/auth/authStore.js +265 -0
- package/build/features/app/bank/bankStore.d.ts +21 -1
- package/build/features/app/bank/bankStore.js +83 -39
- package/build/features/app/business/businessStore.d.ts +22 -3
- package/build/features/app/business/businessStore.js +458 -257
- package/build/features/app/connect/connectStore.d.ts +33 -30
- package/build/features/app/connect/connectStore.js +398 -258
- package/build/features/app/entity/entityStore.d.ts +53 -0
- package/build/features/app/entity/entityStore.js +461 -0
- package/build/features/app/individual/individualStore.d.ts +22 -1
- package/build/features/app/individual/individualStore.js +170 -86
- package/build/features/app/password/passwordStore.d.ts +10 -2
- package/build/features/app/password/passwordStore.js +5 -5
- package/build/features/app/tax/taxStore.js +6 -5
- package/build/features/auth/Auth.d.ts +10 -0
- package/build/features/auth/Auth.js +87 -0
- package/build/features/auth/index.d.ts +1 -0
- package/build/features/auth/index.js +1 -0
- package/build/features/auth/screens/NID/DOB.d.ts +7 -0
- package/build/features/auth/screens/NID/DOB.js +47 -0
- package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
- package/build/features/auth/screens/NID/IDNumber.js +64 -0
- package/build/features/auth/screens/NID/NID.d.ts +5 -0
- package/build/features/auth/screens/NID/NID.js +67 -0
- package/build/features/auth/screens/NID/TAC.d.ts +3 -0
- package/build/features/auth/screens/NID/TAC.js +87 -0
- package/build/features/auth/screens/NID/index.d.ts +3 -0
- package/build/features/auth/screens/NID/index.js +2 -0
- package/build/features/auth/screens/NID/validation.d.ts +27 -0
- package/build/features/auth/screens/NID/validation.js +19 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTP.js +76 -0
- package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTPInput.js +51 -0
- package/build/features/auth/screens/OTP/index.d.ts +3 -0
- package/build/features/auth/screens/OTP/index.js +2 -0
- package/build/features/auth/screens/OTP/validation.d.ts +8 -0
- package/build/features/auth/screens/OTP/validation.js +4 -0
- package/build/features/bank/Bank.js +12 -6
- package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
- package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
- package/build/features/bank/screens/BankDetails/validation.js +2 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +14 -7
- package/build/features/business/screens/Activities/Activities.js +1 -6
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
- package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
- package/build/features/business/screens/Activities/validation.d.ts +0 -51
- package/build/features/business/screens/Activities/validation.js +0 -9
- package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
- package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
- package/build/features/business/screens/BusinessType/EntityName.js +56 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
- package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
- package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
- package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
- package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
- package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
- package/build/features/business/screens/BusinessType/validation.js +50 -1
- package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/business/screens/CivilID/CivilID.js +84 -0
- package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/business/screens/CivilID/IDNumber.js +59 -0
- package/build/features/business/screens/CivilID/index.d.ts +3 -0
- package/build/features/business/screens/CivilID/index.js +2 -0
- package/build/features/business/screens/CivilID/validation.d.ts +8 -0
- package/build/features/business/screens/CivilID/validation.js +4 -0
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
- package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
- package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
- package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
- package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -8
- package/build/features/business/screens/Verify/Verify.js +4 -4
- package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACI.js +156 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +22 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/business/screens/VerifyPACI/index.js +2 -0
- package/build/features/connect/Connect.d.ts +2 -1
- package/build/features/connect/Connect.js +47 -12
- package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
- package/build/features/connect/screens/CivilID/CivilID.js +86 -0
- package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
- package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
- package/build/features/connect/screens/CivilID/index.d.ts +3 -0
- package/build/features/connect/screens/CivilID/index.js +2 -0
- package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
- package/build/features/connect/screens/CivilID/validation.js +4 -0
- package/build/features/connect/screens/Individual/Email.js +11 -3
- package/build/features/connect/screens/Individual/Individual.js +27 -14
- package/build/features/connect/screens/Merchant/BrandList.js +15 -7
- package/build/features/connect/screens/Merchant/BrandName.js +7 -4
- package/build/features/connect/screens/Merchant/Merchant.js +47 -50
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
- package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
- package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
- package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
- package/build/features/connect/screens/Merchant/TAC.js +8 -2
- package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
- package/build/features/connect/screens/Merchant/validation.js +117 -116
- package/build/features/connect/screens/Mobile/Mobile.js +15 -6
- package/build/features/connect/screens/NID/NID.js +2 -1
- package/build/features/connect/screens/OTP/OTP.js +5 -4
- package/build/features/connect/screens/OTP/OTPInput.js +3 -2
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +158 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
- package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
- package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
- package/build/features/connect/screens/VerifyPACI/index.js +2 -0
- package/build/features/entity/Entity.d.ts +7 -0
- package/build/features/entity/Entity.js +70 -0
- package/build/features/entity/index.d.ts +1 -0
- package/build/features/entity/index.js +1 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +56 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
- package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
- package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -4
- package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +2 -0
- package/build/features/entity/screens/EntityInfoConfirm/index.js +2 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
- package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
- package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -0
- package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/entity/screens/Success/Success.d.ts +5 -0
- package/build/features/entity/screens/Success/Success.js +16 -0
- package/build/features/entity/screens/Success/index.d.ts +3 -0
- package/build/features/entity/screens/Success/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +110 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/entity/screens/Verify/OTPInput.js +47 -0
- package/build/features/entity/screens/Verify/Verify.d.ts +5 -0
- package/build/features/entity/screens/Verify/Verify.js +78 -0
- package/build/features/entity/screens/Verify/index.d.ts +2 -0
- package/build/features/entity/screens/Verify/index.js +2 -0
- package/build/features/entity/screens/Verify/validation.d.ts +8 -0
- package/build/features/entity/screens/Verify/validation.js +4 -0
- package/build/features/featuresScreens.d.ts +2 -0
- package/build/features/featuresScreens.js +56 -0
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +14 -7
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
- package/build/features/individual/screens/Verify/Verify.js +4 -4
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +14 -7
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
- package/build/features/shared/Background/Background.d.ts +7 -5
- package/build/features/shared/Background/Background.js +16 -5
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
- package/build/features/shared/Button/MobileButton.d.ts +2 -1
- package/build/features/shared/Button/MobileButton.js +2 -2
- package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
- package/build/features/shared/Dialog/CloseDialog.js +71 -0
- package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
- package/build/features/shared/Dialog/DialogContainer.js +56 -0
- package/build/features/shared/Dialog/index.d.ts +4 -0
- package/build/features/shared/Dialog/index.js +4 -0
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/features/shared/UploadFile/UploadFile.d.ts +9 -3
- package/build/features/shared/UploadFile/UploadFile.js +23 -8
- package/build/features/signIn/SignIn.d.ts +1 -1
- package/build/features/signIn/SignIn.js +14 -6
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +16 -8
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +3 -1
- package/build/hooks/useAppConfig.js +4 -2
- package/build/hooks/useAppDispatch.d.ts +2 -0
- package/build/hooks/useErrorListener.js +0 -5
- package/build/hooks/useScreen.d.ts +3 -0
- package/build/hooks/useScreen.js +14 -0
- package/build/index.d.ts +4 -2
- package/build/index.js +8 -2
- package/build/utils/array.d.ts +13 -1
- package/build/utils/array.js +26 -0
- package/build/utils/common.d.ts +1 -0
- package/build/utils/common.js +3 -0
- package/build/utils/device.d.ts +1 -0
- package/build/utils/device.js +13 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.js +1 -0
- package/build/utils/locale.js +1 -1
- package/build/utils/object.d.ts +1 -0
- package/build/utils/object.js +12 -0
- package/build/utils/rsa.d.ts +2 -2
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +33 -20
- package/build/utils/string.js +71 -1
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +129 -128
|
@@ -22,7 +22,9 @@ import Text from '../../../../components/Text';
|
|
|
22
22
|
import Warning from '../../../../components/Warning';
|
|
23
23
|
import { useLanguage } from '../../../../hooks';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
|
-
import { EXTERNAL_LINKS } from '../../../../constants';
|
|
25
|
+
import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
|
|
26
|
+
import { settingsSelector } from '../../../../app/settings';
|
|
27
|
+
import { useAppSelector } from '../../../../hooks';
|
|
26
28
|
var TACContainerStyled = styled(Box)(function (_a) {
|
|
27
29
|
var theme = _a.theme;
|
|
28
30
|
return ({
|
|
@@ -69,12 +71,16 @@ var TAC = function (_a) {
|
|
|
69
71
|
var t = useTranslation().t;
|
|
70
72
|
var isAr = useLanguage().isAr;
|
|
71
73
|
var control = useFormContext().control;
|
|
74
|
+
var settingsData = useAppSelector(settingsSelector).data;
|
|
72
75
|
var tacControl = useController({ control: control, name: 'termAndConditionChecked' });
|
|
73
76
|
var tacChecked = tacControl.field.value;
|
|
74
77
|
var warningMessage = (_b = tacControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
78
|
+
var countryCode = settingsData.businessCountry.iso2.toLowerCase();
|
|
75
79
|
var handleTACCheckedChange = function (event, checked) {
|
|
76
80
|
tacControl.field.onChange(checked);
|
|
77
81
|
};
|
|
78
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr
|
|
82
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr
|
|
83
|
+
? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR
|
|
84
|
+
: TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }) })));
|
|
79
85
|
};
|
|
80
86
|
export default React.memo(TAC);
|
|
@@ -1,55 +1,32 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
EXISTING_USER_WITH_OTHER_BRAND = "EXISTING_USER_WITH_OTHER_BRAND"
|
|
6
|
-
}
|
|
7
|
-
export declare const MerchantValidationSchema: (userType: ValidationOptions) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
8
|
-
brandName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
9
|
-
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, boolean | undefined>;
|
|
10
|
-
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
11
|
-
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
13
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
2
|
+
export declare const MerchantValidationSchema: (isNewBrand?: boolean) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
5
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
|
-
|
|
16
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
17
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
6
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
18
7
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
8
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>>[] | undefined>;
|
|
23
12
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
27
|
-
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
28
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
29
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
13
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
14
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
30
15
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
31
|
-
|
|
32
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
33
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
16
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
34
17
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
18
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
19
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
20
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
21
|
+
}>>[] | undefined>;
|
|
39
22
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
43
|
-
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
44
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
45
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
23
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
46
25
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
47
|
-
|
|
48
|
-
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
49
|
-
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
26
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
50
27
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
28
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
29
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
30
|
+
id: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
31
|
+
}>>[] | undefined>;
|
|
55
32
|
}>>>;
|
|
@@ -1,131 +1,132 @@
|
|
|
1
|
-
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
import { REGEX_WEBSITE, REGEX_BRAND_NAME, LINKEDIN_URL, SOCIAL_USERNAME, DIGITS_ONLY, REGEX_PHONE_APP_NAME } from '../../../../constants';
|
|
2
11
|
import * as yup from 'yup';
|
|
3
|
-
|
|
4
|
-
(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
var validationSalesChannels = function (channels) {
|
|
13
|
+
if (channels === void 0) { channels = []; }
|
|
14
|
+
var dic = {};
|
|
15
|
+
var typeDic = {};
|
|
16
|
+
channels.forEach(function (channel) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
if ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) {
|
|
19
|
+
var key_1 = (_b = channel.code) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
20
|
+
if (key_1)
|
|
21
|
+
dic[key_1] = [];
|
|
22
|
+
channel.sub.forEach(function (sub) {
|
|
23
|
+
dic[key_1].push(sub.address || '');
|
|
24
|
+
typeDic[sub.code] = sub.address || '';
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
var key = (_c = channel.code) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
29
|
+
if (key)
|
|
30
|
+
dic[key] = [channel.address || ''];
|
|
31
|
+
typeDic[key] = channel.address || '';
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
for (var key in dic) {
|
|
35
|
+
var values = dic[key];
|
|
36
|
+
var atLestOne = values.every(function (item) { return item === ''; });
|
|
37
|
+
if (atLestOne)
|
|
38
|
+
return "enter_at_least_one_".concat(key);
|
|
39
|
+
}
|
|
40
|
+
console.log('dic', dic);
|
|
41
|
+
console.log('typeDic', typeDic);
|
|
42
|
+
for (var key in typeDic) {
|
|
43
|
+
var value = typeDic[key];
|
|
44
|
+
if (key === 'website' && value && !value.match(REGEX_WEBSITE)) {
|
|
45
|
+
return 'invalid_url';
|
|
46
|
+
}
|
|
47
|
+
if (key === 'linkedin' && value && !value.match(LINKEDIN_URL)) {
|
|
48
|
+
return 'invalid_linkedin_profile_url';
|
|
49
|
+
}
|
|
50
|
+
if (key === 'facebook' && value && !value.match(SOCIAL_USERNAME)) {
|
|
51
|
+
return 'invalid_facebook_username';
|
|
52
|
+
}
|
|
53
|
+
if (key === 'instagram' && value && !value.match(SOCIAL_USERNAME)) {
|
|
54
|
+
return 'invalid_instagram_username';
|
|
55
|
+
}
|
|
56
|
+
if (key === 'twitter' && value && !value.match(SOCIAL_USERNAME)) {
|
|
57
|
+
return 'invalid_twitter_username';
|
|
58
|
+
}
|
|
59
|
+
if (key === 'physical_store' && value && value.length < 3) {
|
|
60
|
+
return 'invalid_physical_store_location';
|
|
61
|
+
}
|
|
62
|
+
if (key === 'ios' && value && !value.match(REGEX_PHONE_APP_NAME)) {
|
|
63
|
+
return 'invalid_ios_app';
|
|
64
|
+
}
|
|
65
|
+
if (key === 'android' && value && !value.match(REGEX_PHONE_APP_NAME)) {
|
|
66
|
+
return 'invalid_android_app';
|
|
67
|
+
}
|
|
68
|
+
if (key === 'call_center' && value && !value.match(DIGITS_ONLY)) {
|
|
69
|
+
return 'invalid_call_center_number';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
};
|
|
74
|
+
export var MerchantValidationSchema = function (isNewBrand) {
|
|
75
|
+
if (isNewBrand === void 0) { isNewBrand = true; }
|
|
76
|
+
if (isNewBrand)
|
|
12
77
|
return yup.object().shape({
|
|
13
78
|
brandName: yup
|
|
14
79
|
.string()
|
|
80
|
+
.test({
|
|
81
|
+
test: function (value) {
|
|
82
|
+
if (length === 0)
|
|
83
|
+
return true;
|
|
84
|
+
if (length < 3 || !(value === null || value === void 0 ? void 0 : value.match(REGEX_BRAND_NAME)))
|
|
85
|
+
return this.createError({ message: 'enter_brand_name_english_chars_numbers_space' });
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
.required('enter_brand_name_english_chars_numbers_space'),
|
|
90
|
+
termAndConditionChecked: yup.boolean().isTrue('check_terms_cond').required('check_terms_cond'),
|
|
91
|
+
salesChannels: yup
|
|
92
|
+
.array()
|
|
93
|
+
.min(1, 'choose_atleast_one_channel')
|
|
94
|
+
.of(yup.object().shape({
|
|
95
|
+
id: yup.string().required('choose_atleast_one_channel')
|
|
96
|
+
}))
|
|
15
97
|
.test({
|
|
16
98
|
test: function (value) {
|
|
17
99
|
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
18
100
|
if (length === 0)
|
|
19
101
|
return true;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
102
|
+
var channels = __spreadArray([], (value || []), true);
|
|
103
|
+
var result = validationSalesChannels(channels);
|
|
104
|
+
if (result === true)
|
|
105
|
+
return true;
|
|
106
|
+
return this.createError({ message: result });
|
|
23
107
|
}
|
|
24
108
|
})
|
|
25
|
-
.required('')
|
|
26
|
-
termAndConditionChecked: yup.boolean().required().isTrue('check_terms_cond'),
|
|
27
|
-
links: yup.object().shape({
|
|
28
|
-
website: yup.string().when(['instagram', 'twitter'], function (instagram, twitter) {
|
|
29
|
-
if (!instagram && !twitter) {
|
|
30
|
-
return yup
|
|
31
|
-
.string()
|
|
32
|
-
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
33
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
34
|
-
.nullable()
|
|
35
|
-
.required('enter_at_least_one');
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return yup
|
|
39
|
-
.string()
|
|
40
|
-
.matches(REGEX_WEBSITE, 'ide_not_valid_url')
|
|
41
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
42
|
-
.nullable()
|
|
43
|
-
.optional();
|
|
44
|
-
}
|
|
45
|
-
}),
|
|
46
|
-
instagram: yup
|
|
47
|
-
.string()
|
|
48
|
-
.nullable()
|
|
49
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
50
|
-
.when(['twitter', 'website'], function (twitter, website) {
|
|
51
|
-
if (!website && !twitter) {
|
|
52
|
-
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
return yup.string().optional();
|
|
56
|
-
}
|
|
57
|
-
}),
|
|
58
|
-
twitter: yup
|
|
59
|
-
.string()
|
|
60
|
-
.nullable()
|
|
61
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
62
|
-
.min(2, 'enter_at_least_one')
|
|
63
|
-
.when(['website', 'instagram'], function (website, instagram) {
|
|
64
|
-
if (!website && !instagram) {
|
|
65
|
-
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
return yup.string().optional();
|
|
69
|
-
}
|
|
70
|
-
})
|
|
71
|
-
}, [
|
|
72
|
-
['instagram', 'website'],
|
|
73
|
-
['twitter', 'website'],
|
|
74
|
-
['instagram', 'twitter']
|
|
75
|
-
])
|
|
109
|
+
.required('choose_atleast_one_channel')
|
|
76
110
|
});
|
|
77
|
-
}
|
|
78
111
|
return yup.object().shape({
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
}),
|
|
100
|
-
instagram: yup
|
|
101
|
-
.string()
|
|
102
|
-
.nullable()
|
|
103
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
104
|
-
.when(['twitter', 'website'], function (twitter, website) {
|
|
105
|
-
if (!website && !twitter) {
|
|
106
|
-
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
return yup.string().optional();
|
|
110
|
-
}
|
|
111
|
-
}),
|
|
112
|
-
twitter: yup
|
|
113
|
-
.string()
|
|
114
|
-
.nullable()
|
|
115
|
-
.transform(function (value) { return (!!value ? value : null); })
|
|
116
|
-
.min(2, 'enter_at_least_one')
|
|
117
|
-
.when(['website', 'instagram'], function (website, instagram) {
|
|
118
|
-
if (!website && !instagram) {
|
|
119
|
-
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
return yup.string().optional();
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
}, [
|
|
126
|
-
['instagram', 'website'],
|
|
127
|
-
['twitter', 'website'],
|
|
128
|
-
['instagram', 'twitter']
|
|
129
|
-
])
|
|
112
|
+
salesChannels: yup
|
|
113
|
+
.array()
|
|
114
|
+
.min(1, 'choose_atleast_one_channel')
|
|
115
|
+
.of(yup.object().shape({
|
|
116
|
+
id: yup.string().required('choose_atleast_one_channel')
|
|
117
|
+
}))
|
|
118
|
+
.test({
|
|
119
|
+
test: function (value) {
|
|
120
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
121
|
+
if (length === 0)
|
|
122
|
+
return true;
|
|
123
|
+
var channels = __spreadArray([], (value || []), true);
|
|
124
|
+
var result = validationSalesChannels(channels);
|
|
125
|
+
if (result === true)
|
|
126
|
+
return true;
|
|
127
|
+
return this.createError({ message: result });
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
.required('choose_atleast_one_channel')
|
|
130
131
|
});
|
|
131
132
|
};
|
|
@@ -18,17 +18,19 @@ 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, { AbsherButton } from '../../../shared/Button';
|
|
21
|
+
import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
|
|
22
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
23
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
25
|
-
import { clearError, connectSelector, createMobileAuth } from '../../../app/connect/connectStore';
|
|
25
|
+
import { clearError, connectSelector, createMobileAuth, resetNIDScreen, resetCivilScreen, resetOTPScreen } from '../../../app/connect/connectStore';
|
|
26
26
|
import { useLanguage } from '../../../../hooks';
|
|
27
27
|
import Divider from '@mui/material/Divider';
|
|
28
|
+
import { isKW } from '../../../../utils';
|
|
28
29
|
import Text from '../../../../components/Text';
|
|
29
30
|
import MIDTitle from './Title';
|
|
30
31
|
import MobileNumber from './MobileNumber';
|
|
31
32
|
import { PhoneValidationSchema } from './validation';
|
|
33
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
32
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
33
35
|
display: 'flex',
|
|
34
36
|
flexDirection: 'column'
|
|
@@ -72,9 +74,10 @@ var ListType;
|
|
|
72
74
|
ListType["CountryCodeList"] = "CountryCodeList";
|
|
73
75
|
})(ListType || (ListType = {}));
|
|
74
76
|
var Mobile = function (_a) {
|
|
77
|
+
var _b;
|
|
75
78
|
var settingsStore = useAppSelector(settingsSelector);
|
|
76
|
-
var
|
|
77
|
-
var
|
|
79
|
+
var _c = useAppSelector(connectSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
80
|
+
var _d = React.useState(), listType = _d[0], setListType = _d[1];
|
|
78
81
|
var dispatch = useAppDispatch();
|
|
79
82
|
var methods = useForm({
|
|
80
83
|
resolver: yupResolver(PhoneValidationSchema),
|
|
@@ -91,15 +94,21 @@ var Mobile = function (_a) {
|
|
|
91
94
|
methods.setValue('countryCode', data.mobileData.countryCode);
|
|
92
95
|
}
|
|
93
96
|
}, [data.mobileData]);
|
|
97
|
+
React.useEffect(function () {
|
|
98
|
+
dispatch(resetOTPScreen());
|
|
99
|
+
}, []);
|
|
94
100
|
React.useEffect(function () {
|
|
95
101
|
if (error)
|
|
96
102
|
dispatch(clearError());
|
|
97
103
|
}, [methods.formState.isValid]);
|
|
98
104
|
var onSubmit = function (formData) {
|
|
99
105
|
dispatch(createMobileAuth(formData));
|
|
106
|
+
dispatch(resetNIDScreen());
|
|
107
|
+
dispatch(resetCivilScreen());
|
|
100
108
|
};
|
|
109
|
+
var isKWCountry = React.useMemo(function () { var _a; return isKW((_a = settingsStore.data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2); }, [(_b = settingsStore.data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2]);
|
|
101
110
|
var onBack = function () {
|
|
102
|
-
dispatch(handlePrevScreenStep());
|
|
111
|
+
dispatch(handlePrevScreenStep(isKWCountry ? 'CONNECT_CIVIL_ID_STEP' : 'CONNECT_NID_STEP'));
|
|
103
112
|
};
|
|
104
113
|
var isBusinessListActive = listType === ListType.BusinessList;
|
|
105
114
|
var isCountryListActive = listType === ListType.CountryCodeList;
|
|
@@ -107,6 +116,6 @@ var Mobile = function (_a) {
|
|
|
107
116
|
var disabled = !methods.formState.isValid || !!error;
|
|
108
117
|
var title = t('join_our_community');
|
|
109
118
|
var subTitle = t('ide_terms_and_conditions_description');
|
|
110
|
-
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({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: 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(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') }))] }))] }))] })) }))] }));
|
|
119
|
+
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({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: 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, {})] }), 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') })))] }))] }))] })) }))] }));
|
|
111
120
|
};
|
|
112
121
|
export default React.memo(Mobile);
|
|
@@ -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 { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
21
|
-
import { clearError, connectSelector, createNIDAuth } from '../../../app/connect/connectStore';
|
|
21
|
+
import { clearError, connectSelector, createNIDAuth, resetMobileScreen } 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';
|
|
@@ -73,6 +73,7 @@ var NID = function (_a) {
|
|
|
73
73
|
}, [methods.formState.isValid]);
|
|
74
74
|
var onSubmit = function (data) {
|
|
75
75
|
dispatch(createNIDAuth(data));
|
|
76
|
+
dispatch(resetMobileScreen(settingsStore.data.businessCountry));
|
|
76
77
|
};
|
|
77
78
|
var handleCollapseOpenClose = function (flag) {
|
|
78
79
|
setCollapse(flag);
|
|
@@ -21,6 +21,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
21
21
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
22
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
23
|
import { useLanguage } from '../../../../hooks';
|
|
24
|
+
import { AuthForType } from '../../../../@types';
|
|
24
25
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
25
26
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
26
27
|
import Form from '../../../../components/Form';
|
|
@@ -57,7 +58,7 @@ var OTP = function () {
|
|
|
57
58
|
});
|
|
58
59
|
var t = useTranslation().t;
|
|
59
60
|
var isAr = useLanguage().isAr;
|
|
60
|
-
var
|
|
61
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
61
62
|
React.useEffect(function () {
|
|
62
63
|
if (error)
|
|
63
64
|
dispatch(clearError());
|
|
@@ -69,12 +70,12 @@ var OTP = function () {
|
|
|
69
70
|
dispatch(verifyAuth(formData));
|
|
70
71
|
};
|
|
71
72
|
var onBack = function () {
|
|
72
|
-
dispatch(handlePrevScreenStep(
|
|
73
|
+
dispatch(handlePrevScreenStep(startWithNID ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
|
|
73
74
|
};
|
|
74
75
|
var disabled = !methods.formState.isValid || !!error;
|
|
75
76
|
var phone = ((_a = data.mobileData.countryCode) === null || _a === void 0 ? void 0 : _a.idd_prefix) + (data.mobileData.mobile || '');
|
|
76
77
|
var idNumber = data.nidData.nid;
|
|
77
|
-
var title =
|
|
78
|
-
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:
|
|
78
|
+
var title = startWithNID ? t('opt_nid_sent_title', { provider: 'ABSHER' }) : t('ide_opt_sent_title');
|
|
79
|
+
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') }))] })) })) }));
|
|
79
80
|
};
|
|
80
81
|
export default React.memo(OTP);
|
|
@@ -17,6 +17,7 @@ import Box from '@mui/material/Box/Box';
|
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import OTPField from '../../../shared/OTP';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
+
import { AuthForType } from '../../../../@types';
|
|
20
21
|
import { connectSelector, resendOTPMobile, resendOTPNID } from '../../../app/connect/connectStore';
|
|
21
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
@@ -33,7 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var dispatch = useAppDispatch();
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var data = useAppSelector(connectSelector).data;
|
|
36
|
-
var
|
|
37
|
+
var startWithNID = data.otpData.authFor === AuthForType.NATIONAL_ID;
|
|
37
38
|
var handleOnOTPChange = function (otp) {
|
|
38
39
|
otpControl.field.onChange(otp);
|
|
39
40
|
};
|
|
@@ -48,6 +49,6 @@ var OTPInput = function (_a) {
|
|
|
48
49
|
dispatch(resendOTPNID());
|
|
49
50
|
};
|
|
50
51
|
var otpValue = otpControl.field.value;
|
|
51
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick:
|
|
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()); } }) })));
|
|
52
53
|
};
|
|
53
54
|
export default React.memo(OTPInput);
|