@tap-payments/auth-jsconnect 1.0.10 → 1.0.14

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.
Files changed (148) hide show
  1. package/build/@types/app.d.ts +5 -0
  2. package/build/assets/locales/ar.json +190 -72
  3. package/build/assets/locales/en.json +207 -75
  4. package/build/components/AnimationFlow/Dialog.js +12 -1
  5. package/build/components/DatePicker/DatePicker.d.ts +3 -1
  6. package/build/components/DatePicker/DatePicker.js +8 -5
  7. package/build/components/Loader/Loader.js +2 -2
  8. package/build/components/Radio/Radio.d.ts +5 -0
  9. package/build/components/Radio/Radio.js +31 -0
  10. package/build/components/Radio/index.d.ts +3 -0
  11. package/build/components/Radio/index.js +2 -0
  12. package/build/components/RadioGroup/RadioGroup.d.ts +5 -0
  13. package/build/components/RadioGroup/RadioGroup.js +41 -0
  14. package/build/components/RadioGroup/index.d.ts +3 -0
  15. package/build/components/RadioGroup/index.js +2 -0
  16. package/build/components/RadioLabel/RadioLabel.d.ts +7 -0
  17. package/build/components/RadioLabel/RadioLabel.js +34 -0
  18. package/build/components/RadioLabel/index.d.ts +3 -0
  19. package/build/components/RadioLabel/index.js +2 -0
  20. package/build/constants/app.js +19 -7
  21. package/build/constants/dummy.d.ts +5 -0
  22. package/build/constants/dummy.js +8 -0
  23. package/build/features/bank/Bank.js +1 -1
  24. package/build/features/bank/screens/BankDetails/BankName.js +1 -1
  25. package/build/features/bank/screens/BankDetails/Beneficiary.js +3 -3
  26. package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
  27. package/build/features/bank/screens/BankDetails/validation.js +8 -3
  28. package/build/features/bank/screens/Success/Success.d.ts +5 -0
  29. package/build/features/bank/screens/Success/Success.js +14 -0
  30. package/build/features/bank/screens/Success/index.d.ts +3 -0
  31. package/build/features/bank/screens/Success/index.js +2 -0
  32. package/build/features/business/Business.js +1 -1
  33. package/build/features/business/screens/Activities/Activities.js +14 -40
  34. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  35. package/build/features/business/screens/Activities/OperationStartDate.d.ts +6 -0
  36. package/build/features/business/screens/Activities/OperationStartDate.js +31 -0
  37. package/build/features/business/screens/Activities/SalesChannels.js +3 -10
  38. package/build/features/business/screens/Activities/validation.d.ts +3 -0
  39. package/build/features/business/screens/Activities/validation.js +3 -2
  40. package/build/features/business/screens/BusinessType/BusinessType.js +2 -2
  41. package/build/features/business/screens/BusinessType/CRNumber.js +1 -1
  42. package/build/features/business/screens/BusinessType/CompanyLicense.js +1 -1
  43. package/build/features/business/screens/BusinessType/FLNumber.js +1 -1
  44. package/build/features/business/screens/BusinessType/FreelanceLicense.js +1 -1
  45. package/build/features/business/screens/BusinessType/SelectType.js +1 -1
  46. package/build/features/business/screens/Confirm/Confirm.js +1 -1
  47. package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
  48. package/build/features/business/screens/Customers/Customers.js +5 -41
  49. package/build/features/business/screens/Customers/ExpectedCustomers.js +4 -10
  50. package/build/features/business/screens/Customers/ExpectedSalesRange.js +5 -6
  51. package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
  52. package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
  53. package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
  54. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  55. package/build/features/business/screens/Customers/validation.js +10 -5
  56. package/build/features/business/screens/IDBOD/DOB.d.ts +2 -1
  57. package/build/features/business/screens/IDBOD/DOB.js +4 -1
  58. package/build/features/business/screens/IDBOD/ID.js +7 -48
  59. package/build/features/business/screens/IDBOD/IDBOD.js +9 -41
  60. package/build/features/business/screens/IDBOD/validation.js +6 -2
  61. package/build/features/business/screens/OTP/OTP.js +18 -58
  62. package/build/features/business/screens/OTP/OTPInput.js +8 -21
  63. package/build/features/business/screens/Success/Success.js +1 -2
  64. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
  65. package/build/features/business/screens/VerifyNumber/OTPInput.js +12 -42
  66. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
  67. package/build/features/connect/Connect.js +1 -1
  68. package/build/features/connect/screens/Individual/Email.js +7 -1
  69. package/build/features/connect/screens/Individual/Individual.js +0 -28
  70. package/build/features/connect/screens/Individual/Name.js +9 -3
  71. package/build/features/connect/screens/Individual/validation.js +5 -2
  72. package/build/features/connect/screens/MID/BusinessCountry.js +4 -4
  73. package/build/features/connect/screens/MID/IDNumber.js +9 -6
  74. package/build/features/connect/screens/MID/MID.js +2 -2
  75. package/build/features/connect/screens/MID/MobileNumber.js +13 -15
  76. package/build/features/connect/screens/MID/validation.d.ts +1 -1
  77. package/build/features/connect/screens/MID/validation.js +11 -5
  78. package/build/features/connect/screens/Merchant/BrandName.js +5 -3
  79. package/build/features/connect/screens/Merchant/SocialMedia.js +6 -1
  80. package/build/features/connect/screens/Merchant/TAC.js +2 -2
  81. package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
  82. package/build/features/connect/screens/Merchant/validation.js +42 -11
  83. package/build/features/connect/screens/OTP/OTP.js +4 -3
  84. package/build/features/connect/screens/OTP/OTPInput.js +1 -1
  85. package/build/features/connect/screens/OTP/validation.js +1 -1
  86. package/build/features/connect/screens/Password/PasswordInput.js +2 -1
  87. package/build/features/connect/screens/Password/validation.js +1 -1
  88. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
  89. package/build/features/featuresScreens.d.ts +1 -1
  90. package/build/features/featuresScreens.js +32 -7
  91. package/build/features/owner/Owner.js +1 -1
  92. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +8 -0
  93. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +77 -0
  94. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +10 -0
  95. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +80 -0
  96. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +6 -0
  97. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +40 -0
  98. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +6 -0
  99. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +45 -0
  100. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +6 -0
  101. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +35 -0
  102. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +6 -0
  103. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +45 -0
  104. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +9 -0
  105. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +85 -0
  106. package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +3 -0
  107. package/build/features/owner/screens/AdditionalOwnerInfo/index.js +2 -0
  108. package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +25 -0
  109. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +35 -0
  110. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +2 -2
  111. package/build/features/owner/screens/Success/Success.d.ts +5 -0
  112. package/build/features/owner/screens/Success/Success.js +14 -0
  113. package/build/features/owner/screens/Success/index.d.ts +3 -0
  114. package/build/features/owner/screens/Success/index.js +2 -0
  115. package/build/features/password/Password.js +3 -3
  116. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +2 -1
  117. package/build/features/password/screens/CreatePassword/Password.js +2 -1
  118. package/build/features/password/screens/CreatePassword/validation.js +3 -3
  119. package/build/features/password/screens/Success/Success.d.ts +5 -0
  120. package/build/features/password/screens/Success/Success.js +14 -0
  121. package/build/features/password/screens/Success/index.d.ts +3 -0
  122. package/build/features/password/screens/Success/index.js +2 -0
  123. package/build/features/shared/Button/Button.js +7 -1
  124. package/build/features/shared/ExpandIcon/ExpandIcon.js +1 -1
  125. package/build/features/shared/Input/Input.d.ts +0 -1
  126. package/build/features/shared/Input/Input.js +2 -5
  127. package/build/features/shared/Mandatory/Mandatory.d.ts +2 -0
  128. package/build/features/shared/Mandatory/Mandatory.js +20 -0
  129. package/build/features/shared/Mandatory/index.d.ts +2 -0
  130. package/build/features/shared/Mandatory/index.js +2 -0
  131. package/build/features/shared/OTP/OTP.js +2 -2
  132. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  133. package/build/features/tax/screens/Success/Success.d.ts +5 -0
  134. package/build/features/tax/screens/Success/Success.js +14 -0
  135. package/build/features/tax/screens/Success/index.d.ts +3 -0
  136. package/build/features/tax/screens/Success/index.js +2 -0
  137. package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
  138. package/build/features/tax/screens/TaxDetails/validation.js +1 -1
  139. package/build/index.css +105 -3
  140. package/build/theme/typography.js +2 -2
  141. package/build/utils/string.js +2 -2
  142. package/build/utils/validation.d.ts +2 -0
  143. package/build/utils/validation.js +6 -0
  144. package/package.json +1 -1
  145. package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
  146. package/build/features/business/screens/OTP/OTPTimer.js +0 -20
  147. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
  148. package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
@@ -10,82 +10,41 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
- import { styled } from '@mui/material/styles';
15
13
  import * as React from 'react';
16
- import { useTranslation } from 'react-i18next';
17
- import Text from '../../../../components/Text';
18
- import OTPTimer from './OTPTimer';
19
- import Icon from '../../../../components/Icon';
20
- import Button from '../../../../components/Button';
21
- import Loader from '../../../../components/Loader';
22
- import { ICONS_NAMES } from '../../../../constants/assets';
23
14
  import { useAppDispatch } from '../../../../hooks';
24
- import { handleNextScreenStep } from '../../../../app/settings';
25
- import { useLanguage } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
26
16
  import { useForm, FormProvider } from 'react-hook-form';
27
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
+ import Box from '@mui/material/Box/Box';
19
+ import { styled } from '@mui/material/styles';
20
+ import { handleNextScreenStep } from '../../../../app/settings';
21
+ import { useLanguage } from '../../../../hooks';
28
22
  import Form from '../../../../components/Form';
23
+ import Text from '../../../../components/Text';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import Button from '../../../shared/Button';
29
26
  import { maskID } from '../../../../utils';
30
27
  import { OTPValidation } from './validation';
31
28
  import OTPInput from './OTPInput';
32
- var BoxStyled = styled(Box)(function (_a) {
29
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
33
30
  var theme = _a.theme;
34
31
  return ({
35
- display: 'flex',
36
- flexDirection: 'column',
37
- overflow: 'hidden',
38
- direction: theme.direction
32
+ background: theme.palette.common.white,
33
+ border: '1px solid',
34
+ borderColor: theme.palette.divider,
35
+ direction: theme.direction,
36
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
37
+ marginBottom: theme.spacing(5.75)
39
38
  });
40
39
  });
41
- var OTPTitleContainerStyled = styled(Box)(function (_a) {
42
- var _b;
43
- var theme = _a.theme;
44
- return (_b = {
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
- },
51
- _b[theme.breakpoints.up('sm')] = {
52
- marginBottom: theme.spacing(6)
53
- },
54
- _b);
55
- });
56
40
  var OTPTitleStyled = styled(Text)(function (_a) {
57
41
  var theme = _a.theme;
58
- return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
59
- });
60
- var LoaderStyled = styled(Loader)(function (_a) {
61
- var theme = _a.theme;
62
- return ({
63
- marginInlineStart: theme.spacing(-6.25),
64
- '& .loader-box-container': {
65
- marginInlineStart: theme.spacing(2.5)
66
- }
67
- });
42
+ return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
68
43
  });
69
44
  var FormStyled = styled(Form)(function () { return ({
70
45
  display: 'flex',
71
46
  flexDirection: 'column'
72
47
  }); });
73
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
74
- var theme = _a.theme, isAr = _a.isAr;
75
- return ({
76
- width: theme.spacing(3),
77
- height: theme.spacing(3),
78
- paddingInlineStart: theme.spacing(1.5),
79
- paddingInlineEnd: theme.spacing(0.5),
80
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
81
- });
82
- });
83
- var ButtonContainer = styled(Box)(function (_a) {
84
- var theme = _a.theme;
85
- return ({
86
- margin: theme.spacing(2.5)
87
- });
88
- });
89
48
  var OTP = function (_a) {
90
49
  var idNumber = _a.idNumber;
91
50
  var dispatch = useAppDispatch();
@@ -104,7 +63,8 @@ var OTP = function (_a) {
104
63
  return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
105
64
  dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
106
65
  };
107
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('opt_nid_sent_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
66
+ var loading = false;
67
+ 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' }), ' ', _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
108
68
  };
109
69
  OTP.defaultProps = {
110
70
  idNumber: '1234567891'
@@ -10,42 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
13
14
  import Box from '@mui/material/Box/Box';
14
15
  import { styled } from '@mui/material/styles';
15
- import OTPField from '../../../../components/OTPField';
16
- import * as React from 'react';
16
+ import OTPField from '../../../../features/shared/OTP';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
18
20
  var BoxStyled = styled(Box)(function (_a) {
19
21
  var theme = _a.theme;
20
22
  return ({
21
23
  display: 'flex',
22
- flexDirection: 'column'
24
+ flexDirection: 'column',
25
+ marginBottom: theme.spacing(5)
23
26
  });
24
27
  });
25
- var OTPStyled = styled(OTPField)(function (_a) {
26
- var _b;
27
- var theme = _a.theme;
28
- return (_b = {
29
- marginInlineStart: theme.spacing(2.0),
30
- input: {
31
- width: "".concat(theme.spacing(3.75), " !important")
32
- },
33
- '& :focus': {
34
- borderColor: theme.palette.primary.main
35
- }
36
- },
37
- _b[theme.breakpoints.down('sm')] = {
38
- marginInlineStart: theme.spacing(3)
39
- },
40
- _b);
41
- });
42
28
  var OTPInput = function (_a) {
43
29
  var control = useFormContext().control;
30
+ var t = useTranslation().t;
44
31
  var otpControl = useController({ name: 'otp', control: control });
45
32
  var handleOnOTPChange = function (otp) {
46
33
  otpControl.field.onChange(otp);
47
34
  };
48
35
  var otpValue = otpControl.field.value;
49
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
36
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { }, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
50
37
  };
51
38
  export default React.memo(OTPInput);
@@ -8,8 +8,7 @@ var Success = function (_a) {
8
8
  console.log('success');
9
9
  alert('Account created successfully, please check your email');
10
10
  alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
11
- window.location.href = '/new/business';
12
11
  };
13
- return _jsx(SuccessScreen, { title: t('success_message'), onSuccess: onSuccess });
12
+ return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess });
14
13
  };
15
14
  export default React.memo(Success);
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  export interface OTPProps {
3
- onOTPChange?: (otp: string) => void;
4
3
  }
5
- declare const _default: React.MemoExoticComponent<({ onOTPChange }: OTPProps) => JSX.Element>;
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
6
5
  export default _default;
@@ -10,59 +10,29 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from 'react';
13
14
  import Box from '@mui/material/Box/Box';
14
15
  import { styled } from '@mui/material/styles';
15
- import OTPField from '../../../../components/OTPField';
16
- import * as React from 'react';
17
- import { useForm, FormProvider, useController, useFormContext } from 'react-hook-form';
18
- import { yupResolver } from '@hookform/resolvers/yup';
19
- import { OTPValidation } from './validation';
16
+ import OTPField from '../../../../features/shared/OTP';
17
+ import { useController, useFormContext } from 'react-hook-form';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
20
  var BoxStyled = styled(Box)(function (_a) {
21
- var _b;
22
- var theme = _a.theme;
23
- return (_b = {
24
- display: 'flex',
25
- flexDirection: 'column',
26
- direction: theme.direction
27
- },
28
- _b[theme.breakpoints.down('sm')] = {
29
- paddingTop: theme.spacing(2.5)
30
- },
31
- _b);
32
- });
33
- var OTPStyled = styled(OTPField)(function (_a) {
34
- var _b;
35
21
  var theme = _a.theme;
36
- return (_b = {
37
- marginInlineStart: theme.spacing(2.0),
38
- input: {
39
- width: "".concat(theme.spacing(3.75), " !important")
40
- },
41
- '& :focus': {
42
- borderColor: theme.palette.primary.main
43
- }
44
- },
45
- _b[theme.breakpoints.down('sm')] = {
46
- marginInlineStart: theme.spacing(3)
47
- },
48
- _b);
22
+ return ({
23
+ display: 'flex',
24
+ flexDirection: 'column',
25
+ marginBottom: theme.spacing(5)
26
+ });
49
27
  });
50
28
  var OTPInput = function (_a) {
51
- var onOTPChange = _a.onOTPChange;
52
- var methods = useForm({
53
- resolver: yupResolver(OTPValidation),
54
- defaultValues: {
55
- otp: ''
56
- },
57
- mode: 'onChange'
58
- });
59
29
  var control = useFormContext().control;
30
+ var t = useTranslation().t;
60
31
  var otpControl = useController({ name: 'otp', control: control });
61
32
  var handleOnOTPChange = function (otp) {
62
33
  otpControl.field.onChange(otp);
63
- onOTPChange === null || onOTPChange === void 0 ? void 0 : onOTPChange(otp);
64
34
  };
65
35
  var otpValue = otpControl.field.value;
66
- return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsx(OTPStyled, { value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })) })));
36
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: function () { }, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
67
37
  };
68
38
  export default React.memo(OTPInput);
@@ -10,88 +10,41 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
- import { styled } from '@mui/material/styles';
15
13
  import * as React from 'react';
16
- import { useTranslation } from 'react-i18next';
17
- import Text from '../../../../components/Text';
18
- import OTPTimer from './OTPTimer';
19
- import Icon from '../../../../components/Icon';
20
- import Button from '../../../../components/Button';
21
- import Loader from '../../../../components/Loader';
22
- import { ICONS_NAMES } from '../../../../constants/assets';
23
14
  import { useAppDispatch } from '../../../../hooks';
24
- import { handleNextScreenStep } from '../../../../app/settings';
25
- import { useLanguage } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
26
16
  import { useForm, FormProvider } from 'react-hook-form';
27
17
  import { yupResolver } from '@hookform/resolvers/yup';
18
+ import Box from '@mui/material/Box/Box';
19
+ import { styled } from '@mui/material/styles';
20
+ import { handleNextScreenStep } from '../../../../app/settings';
21
+ import { useLanguage } from '../../../../hooks';
28
22
  import Form from '../../../../components/Form';
23
+ import Text from '../../../../components/Text';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import Button from '../../../shared/Button';
29
26
  import { maskPhone } from '../../../../utils';
30
27
  import { OTPValidation } from './validation';
31
28
  import OTPInput from './OTPInput';
32
- var BoxStyled = styled(Box)(function (_a) {
33
- var theme = _a.theme;
34
- return ({
35
- display: 'flex',
36
- flexDirection: 'column',
37
- overflow: 'hidden',
38
- direction: theme.direction
39
- });
40
- });
41
- var InputsContainerStyled = styled(Box)(function (_a) {
29
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
42
30
  var theme = _a.theme;
43
31
  return ({
44
- paddingBottom: theme.spacing(3.75)
32
+ background: theme.palette.common.white,
33
+ border: '1px solid',
34
+ borderColor: theme.palette.divider,
35
+ direction: theme.direction,
36
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
37
+ marginBottom: theme.spacing(5.75)
45
38
  });
46
39
  });
47
- var OTPTitleContainerStyled = styled(Box)(function (_a) {
48
- var _b;
49
- var theme = _a.theme;
50
- return (_b = {
51
- background: theme.palette.common.white,
52
- border: '1px solid',
53
- borderColor: theme.palette.divider,
54
- direction: theme.direction,
55
- borderRadius: theme.spacing(0, 0, 1.25, 1.25)
56
- },
57
- _b[theme.breakpoints.up('sm')] = {
58
- marginBottom: theme.spacing(6)
59
- },
60
- _b);
61
- });
62
40
  var OTPTitleStyled = styled(Text)(function (_a) {
63
41
  var theme = _a.theme;
64
- return (__assign(__assign({}, theme.typography.body1), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5) }));
65
- });
66
- var LoaderStyled = styled(Loader)(function (_a) {
67
- var theme = _a.theme;
68
- return ({
69
- marginInlineStart: theme.spacing(-6.25),
70
- '& .loader-box-container': {
71
- marginInlineStart: theme.spacing(2.5)
72
- }
73
- });
42
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
74
43
  });
75
44
  var FormStyled = styled(Form)(function () { return ({
76
45
  display: 'flex',
77
46
  flexDirection: 'column'
78
47
  }); });
79
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
80
- var theme = _a.theme, isAr = _a.isAr;
81
- return ({
82
- width: theme.spacing(3),
83
- height: theme.spacing(3),
84
- paddingInlineStart: theme.spacing(1.5),
85
- paddingInlineEnd: theme.spacing(0.5),
86
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
87
- });
88
- });
89
- var ButtonContainer = styled(Box)(function (_a) {
90
- var theme = _a.theme;
91
- return ({
92
- margin: theme.spacing(2.5)
93
- });
94
- });
95
48
  var VerifyNumber = function (_a) {
96
49
  var phone = _a.phone, code = _a.code;
97
50
  var dispatch = useAppDispatch();
@@ -110,10 +63,11 @@ var VerifyNumber = function (_a) {
110
63
  return dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
111
64
  dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
112
65
  };
113
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [t('service_otp_send_title'), " ", _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(OTPTimer, {})] }), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
66
+ var loading = false;
67
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(code, " ").concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
114
68
  };
115
69
  VerifyNumber.defaultProps = {
116
- phone: '8940298292',
117
- code: '+91'
70
+ phone: '564656085',
71
+ code: '+996'
118
72
  };
119
73
  export default React.memo(VerifyNumber);
@@ -34,7 +34,7 @@ var Connect = memo(function (props) {
34
34
  return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
35
35
  var Element = _a.element, name = _a.name;
36
36
  var isActive = activeScreen.name === name;
37
- return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 600, exit: 400, appear: 600 } }, { children: _jsx(Element, {}) }), index));
37
+ return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
38
38
  }) }) })) })));
39
39
  });
40
40
  export function ConnectLib(props) {
@@ -16,6 +16,8 @@ import { ScreenContainer } from '../../../shared/Containers';
16
16
  import Input from '../../../shared/Input';
17
17
  import { keepEmailCharacters } from '../../../../utils';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
+ import ClearIcon from '../../../shared/ClearIcon';
20
+ import CheckIcon from '../../../shared/CheckIcon';
19
21
  var Email = function (_a) {
20
22
  var _b;
21
23
  var t = useTranslation().t;
@@ -26,6 +28,10 @@ var Email = function (_a) {
26
28
  emailControl.field.onChange(value);
27
29
  };
28
30
  var emailValue = emailControl.field.value;
29
- return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_enter_email'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signin_email_placeholder'), warningType: 'alert', warningMessage: (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
31
+ var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
32
+ var clearNumber = function () {
33
+ emailControl.field.onChange('');
34
+ };
35
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: _jsx(Input, { label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })));
30
36
  };
31
37
  export default React.memo(Email);
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
13
  import { styled } from '@mui/material/styles';
15
14
  import Email from './Email';
16
15
  import Name from './Name';
@@ -18,44 +17,17 @@ import * as React from 'react';
18
17
  import { useTranslation } from 'react-i18next';
19
18
  import { useForm, FormProvider } from 'react-hook-form';
20
19
  import { yupResolver } from '@hookform/resolvers/yup';
21
- import Icon from '../../../../components/Icon';
22
20
  import { useAppDispatch } from '../../../../hooks';
23
21
  import { handleNextScreenStep } from '../../../../app/settings';
24
22
  import { IndividualValidation } from './validation';
25
23
  import Form from '../../../../components/Form';
26
24
  import Button from '../../../shared/Button';
27
25
  import { ScreenContainer } from '../../../shared/Containers';
28
- import Loader from '../../../../components/Loader';
29
26
  import { useLanguage } from '../../../../hooks';
30
27
  var FormStyled = styled(Form)(function () { return ({
31
28
  display: 'flex',
32
29
  flexDirection: 'column'
33
30
  }); });
34
- var ButtonContainer = styled(Box)(function (_a) {
35
- var theme = _a.theme;
36
- return ({
37
- margin: theme.spacing(5, 2.5, 0, 2.5)
38
- });
39
- });
40
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
41
- var theme = _a.theme, isAr = _a.isAr;
42
- return ({
43
- width: theme.spacing(3),
44
- height: theme.spacing(3),
45
- paddingInlineStart: theme.spacing(1.5),
46
- paddingInlineEnd: theme.spacing(0.5),
47
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
48
- });
49
- });
50
- var LoaderStyled = styled(Loader)(function (_a) {
51
- var theme = _a.theme;
52
- return ({
53
- marginInlineStart: theme.spacing(-6.25),
54
- '& .loader-box-container': {
55
- marginInlineStart: theme.spacing(2.5)
56
- }
57
- });
58
- });
59
31
  var Individual = function (_a) {
60
32
  var dispatch = useAppDispatch();
61
33
  var methods = useForm({
@@ -14,18 +14,24 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { ScreenContainer } from '../../../shared/Containers';
16
16
  import Input from '../../../shared/Input';
17
- import { removeAllNumberFromChars } from '../../../../utils';
17
+ import { keepLettersAndSpace } from '../../../../utils';
18
18
  import { useController, useFormContext } from 'react-hook-form';
19
+ import ClearIcon from '../../../shared/ClearIcon';
20
+ import CheckIcon from '../../../shared/CheckIcon';
19
21
  var Name = function (_a) {
20
22
  var _b;
21
23
  var t = useTranslation().t;
22
24
  var control = useFormContext().control;
23
25
  var nameControl = useController({ name: 'name', control: control });
24
26
  var handleNameChange = function (event) {
25
- var value = removeAllNumberFromChars(event.target.value);
27
+ var value = keepLettersAndSpace(event.target.value);
26
28
  nameControl.field.onChange(value);
27
29
  };
28
30
  var nameValue = nameControl.field.value;
29
- return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) })));
31
+ var error = (_b = nameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
32
+ var clearNumber = function () {
33
+ nameControl.field.onChange('');
34
+ };
35
+ return (_jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(Input, { label: t('signup_merchant_name_label'), value: nameValue, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && nameValue ? _jsx(CheckIcon, {}) : nameValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })));
30
36
  };
31
37
  export default React.memo(Name);
@@ -1,5 +1,8 @@
1
1
  import * as yup from 'yup';
2
2
  export var IndividualValidation = yup.object().shape({
3
- name: yup.string().min(3).required('Name is required'),
4
- email: yup.string().email().required('Email is required')
3
+ name: yup
4
+ .string()
5
+ .matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g, 'please write your first and last name')
6
+ .required('please write your first and last name'),
7
+ email: yup.string().email('email_not_valid').required('email_not_valid')
5
8
  });
@@ -29,10 +29,10 @@ import { useController, useFormContext } from 'react-hook-form';
29
29
  import Text from '../../../../components/Text';
30
30
  import Collapse from '../../../../components/Collapse';
31
31
  import CheckIcon from '@mui/icons-material/Check';
32
- import ScreenContainer from '../../../../features/shared/Containers/ScreenContainer';
32
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
33
33
  import Icon from '../../../../components/Icon';
34
- import Input from '../../../../features/shared/Input';
35
- import ExpandIcon from '../../../../features/shared/ExpandIcon';
34
+ import Input from '../../../shared/Input';
35
+ import ExpandIcon from '../../../shared/ExpandIcon';
36
36
  import SimpleList from '../../../../components/SimpleList';
37
37
  import { useLanguage } from '../../../../hooks';
38
38
  var CountryItemContainer = styled(Box)(function () { return ({
@@ -85,7 +85,7 @@ var BusinessCountry = React.forwardRef(function (_a, ref) {
85
85
  businessCountryControl.field.onChange(country);
86
86
  };
87
87
  var businessCountry = businessCountryControl.field.value;
88
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: [_jsx(Input, { label: t('business_country_label'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('business_country_placeholder'), value: (isAr ? (_b = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
88
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: [_jsx(Input, { label: t('signup_select_country'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.logo) || '' }) }), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('ide_mobile_placeholder'), value: (isAr ? (_b = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: businessCountries, onSelectItem: onSelectItem, renderItem: function (item) {
89
89
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsx(CountryIconStyled, { src: item.logo, alt: item.iso3 }), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.idd_prefix) && _jsx(CheckIconStyled, {})] }));
90
90
  } }) }))] })) })));
91
91
  });
@@ -18,8 +18,9 @@ import { styled, alpha } from '@mui/material/styles';
18
18
  import Text from '../../../../components/Text';
19
19
  import Tooltip from '@mui/material/Tooltip';
20
20
  import Icon from '../../../../components/Icon';
21
- import Input from '../../../../features/shared/Input';
22
- import ClearIcon from '../../../../features/shared/ClearIcon';
21
+ import Input from '../../../shared/Input';
22
+ import ClearIcon from '../../../shared/ClearIcon';
23
+ import CheckIcon from '../../../shared/CheckIcon';
23
24
  import Collapse from '../../../../components/Collapse';
24
25
  import DatePicker from '../../../../components/DatePicker';
25
26
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
@@ -46,10 +47,10 @@ var IconStyled = styled(Icon)(function (_a) {
46
47
  });
47
48
  });
48
49
  var IDNumber = React.forwardRef(function (_a, ref) {
49
- var _b;
50
+ var _b, _c;
50
51
  var onSwitchToMobileNumber = _a.onSwitchToMobileNumber, show = _a.show;
51
52
  var t = useTranslation().t;
52
- var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
53
+ var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
53
54
  var nidControl = useController({ control: control, name: 'nid' });
54
55
  var dobControl = useController({ control: control, name: 'dob' });
55
56
  React.useEffect(function () {
@@ -70,9 +71,11 @@ var IDNumber = React.forwardRef(function (_a, ref) {
70
71
  dobControl.field.onChange(data);
71
72
  };
72
73
  var nidValue = nidControl.field.value;
73
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('id_number_label') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }), _jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
74
+ var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
75
+ var dateValue = (_c = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _c === void 0 ? void 0 : _c.value;
76
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('enter_national_id') }), _jsx(Tooltip, __assign({ title: t('switch_to_mobile') }, { children: _jsx(IconStyled, { onClick: onSwitchToMobileNumber, alt: 'switcher icon', src: ICONS_NAMES.MOBILE_IMAGE }) }))] }), _jsx(Input, { dir: 'ltr', inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }), required: true }), _jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
74
77
  var spacing = _a.spacing;
75
78
  return spacing(2.5, 2.5, 1.5, 2.5);
76
- } } }, { children: t('date_of_birth') })), _jsx(DatePicker, { defaultValue: new Date('2000-01-01'), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange })] })) })));
79
+ } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { defaultValue: dateValue ? new Date(dateValue) : new Date(), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange })] })) })));
77
80
  });
78
81
  export default React.memo(IDNumber);
@@ -54,7 +54,7 @@ var MID = function (_a) {
54
54
  var _c = React.useState(), listType = _c[0], setListType = _c[1];
55
55
  var dispatch = useAppDispatch();
56
56
  var methods = useForm({
57
- resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema),
57
+ resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(10)),
58
58
  defaultValues: {
59
59
  countryCode: defaultCountry,
60
60
  businessCountry: defaultCountry,
@@ -76,6 +76,6 @@ var MID = function (_a) {
76
76
  var isBusinessListActive = listType === ListType.BusinessList;
77
77
  var isCountryListActive = listType === ListType.CountryCodeList;
78
78
  var listActive = isBusinessListActive || isCountryListActive;
79
- return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('Welcome to Tap Payments'), description: t('Help us to get your information to start collecting online payments') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(BusinessCountry, { show: !isCountryListActive, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: isNID }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) }))] })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
79
+ return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('join_our_community'), description: t('ide_terms_and_conditions_description') }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(BusinessCountry, { show: !isCountryListActive, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: isNID }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) }))] })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
80
80
  };
81
81
  export default React.memo(MID);