@tap-payments/auth-jsconnect 1.0.13 → 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 (97) hide show
  1. package/build/assets/locales/ar.json +190 -88
  2. package/build/assets/locales/en.json +206 -90
  3. package/build/components/DatePicker/DatePicker.js +3 -3
  4. package/build/components/Loader/Loader.js +2 -2
  5. package/build/constants/app.js +28 -4
  6. package/build/features/bank/screens/BankDetails/BankName.js +1 -1
  7. package/build/features/bank/screens/BankDetails/Beneficiary.js +3 -3
  8. package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
  9. package/build/features/bank/screens/BankDetails/validation.js +8 -3
  10. package/build/features/bank/screens/Success/Success.d.ts +5 -0
  11. package/build/features/bank/screens/Success/Success.js +14 -0
  12. package/build/features/bank/screens/Success/index.d.ts +3 -0
  13. package/build/features/bank/screens/Success/index.js +2 -0
  14. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  15. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  16. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  17. package/build/features/business/screens/Activities/validation.js +3 -3
  18. package/build/features/business/screens/BusinessType/CRNumber.js +1 -1
  19. package/build/features/business/screens/BusinessType/CompanyLicense.js +1 -1
  20. package/build/features/business/screens/BusinessType/FLNumber.js +1 -1
  21. package/build/features/business/screens/BusinessType/FreelanceLicense.js +1 -1
  22. package/build/features/business/screens/BusinessType/SelectType.js +1 -1
  23. package/build/features/business/screens/Confirm/Confirm.js +1 -1
  24. package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
  25. package/build/features/business/screens/Customers/Customers.js +5 -41
  26. package/build/features/business/screens/Customers/ExpectedCustomers.js +4 -10
  27. package/build/features/business/screens/Customers/ExpectedSalesRange.js +5 -6
  28. package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
  29. package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
  30. package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
  31. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  32. package/build/features/business/screens/Customers/validation.js +10 -5
  33. package/build/features/business/screens/IDBOD/ID.js +1 -1
  34. package/build/features/business/screens/IDBOD/validation.js +6 -2
  35. package/build/features/business/screens/OTP/OTP.js +18 -58
  36. package/build/features/business/screens/OTP/OTPInput.js +8 -21
  37. package/build/features/business/screens/Success/Success.js +1 -2
  38. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
  39. package/build/features/business/screens/VerifyNumber/OTPInput.js +12 -42
  40. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
  41. package/build/features/connect/screens/Individual/Email.js +7 -1
  42. package/build/features/connect/screens/Individual/Individual.js +0 -28
  43. package/build/features/connect/screens/Individual/Name.js +9 -3
  44. package/build/features/connect/screens/Individual/validation.js +5 -2
  45. package/build/features/connect/screens/MID/BusinessCountry.js +1 -1
  46. package/build/features/connect/screens/MID/IDNumber.js +2 -2
  47. package/build/features/connect/screens/MID/MID.js +1 -1
  48. package/build/features/connect/screens/MID/MobileNumber.js +7 -1
  49. package/build/features/connect/screens/MID/validation.js +7 -3
  50. package/build/features/connect/screens/Merchant/BrandName.js +3 -1
  51. package/build/features/connect/screens/Merchant/SocialMedia.js +6 -1
  52. package/build/features/connect/screens/Merchant/TAC.js +1 -1
  53. package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
  54. package/build/features/connect/screens/Merchant/validation.js +42 -11
  55. package/build/features/connect/screens/OTP/OTP.js +4 -3
  56. package/build/features/connect/screens/OTP/OTPInput.js +1 -1
  57. package/build/features/connect/screens/OTP/validation.js +1 -1
  58. package/build/features/connect/screens/Password/PasswordInput.js +2 -1
  59. package/build/features/connect/screens/Password/validation.js +1 -1
  60. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
  61. package/build/features/featuresScreens.js +20 -0
  62. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +1 -1
  63. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +1 -1
  64. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +7 -2
  65. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +1 -1
  66. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +1 -1
  67. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +1 -1
  68. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +1 -1
  69. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +6 -3
  70. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +1 -1
  71. package/build/features/owner/screens/Success/Success.d.ts +5 -0
  72. package/build/features/owner/screens/Success/Success.js +14 -0
  73. package/build/features/owner/screens/Success/index.d.ts +3 -0
  74. package/build/features/owner/screens/Success/index.js +2 -0
  75. package/build/features/password/Password.js +2 -2
  76. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +2 -1
  77. package/build/features/password/screens/CreatePassword/Password.js +2 -1
  78. package/build/features/password/screens/CreatePassword/validation.js +3 -3
  79. package/build/features/password/screens/Success/Success.d.ts +5 -0
  80. package/build/features/password/screens/Success/Success.js +14 -0
  81. package/build/features/password/screens/Success/index.d.ts +3 -0
  82. package/build/features/password/screens/Success/index.js +2 -0
  83. package/build/features/shared/Button/Button.js +7 -1
  84. package/build/features/shared/Footer/Footer.js +1 -1
  85. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  86. package/build/features/tax/screens/Success/Success.d.ts +5 -0
  87. package/build/features/tax/screens/Success/Success.js +14 -0
  88. package/build/features/tax/screens/Success/index.d.ts +3 -0
  89. package/build/features/tax/screens/Success/index.js +2 -0
  90. package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
  91. package/build/features/tax/screens/TaxDetails/validation.js +1 -1
  92. package/build/utils/string.js +2 -2
  93. package/package.json +1 -1
  94. package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
  95. package/build/features/business/screens/OTP/OTPTimer.js +0 -20
  96. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
  97. package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
@@ -1,8 +1,13 @@
1
1
  import * as yup from 'yup';
2
+ var objectElements = {
3
+ id: yup.number(),
4
+ name: yup.string(),
5
+ nameAR: yup.string()
6
+ };
2
7
  export var CustomerInfoValidation = yup.object().shape({
3
- customerLocations: yup.array().required(''),
4
- expectedCustomers: yup.array().required(''),
5
- expectedSalesRange: yup.array().required(''),
6
- refundPolicy: yup.boolean().required().isTrue('Please accept the refund policy'),
7
- transactionPolicy: yup.boolean().required().isTrue('Please accept the transaction policy')
8
+ customerLocations: yup.array().required('please_choose_base'),
9
+ expectedCustomers: yup.object().shape(objectElements).required(''),
10
+ expectedSalesRange: yup.object().shape(objectElements).required('select_expected_sales'),
11
+ refundPolicy: yup.boolean().required().isTrue('refund_policy_error'),
12
+ transactionPolicy: yup.boolean().required().isTrue('transaction_policy_error')
8
13
  });
@@ -23,6 +23,6 @@ var IDNumber = function (_a) {
23
23
  };
24
24
  var nidValue = nidControl.field.value;
25
25
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
26
- return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('id_number_label'), 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) }) }));
26
+ return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_national_id'), 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' }) }) }));
27
27
  };
28
28
  export default React.memo(IDNumber);
@@ -1,5 +1,9 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('dob_is_required'),
4
- nid: yup.string().min(8, 'id_number_label_error').max(10, 'id_number_label_error').required('id_number_label_error')
3
+ dob: yup.string().min(5).required('enter_valid_birth_date'),
4
+ nid: yup
5
+ .string()
6
+ .min(8, 'signup_invalid_national_id_format')
7
+ .max(10, 'signup_invalid_national_id_format')
8
+ .required('signup_invalid_national_id')
5
9
  });
@@ -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);
@@ -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
  });
@@ -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
  });
@@ -73,9 +73,9 @@ var IDNumber = React.forwardRef(function (_a, ref) {
73
73
  var nidValue = nidControl.field.value;
74
74
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
75
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('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: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error), required: true }), _jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
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) {
77
77
  var spacing = _a.spacing;
78
78
  return spacing(2.5, 2.5, 1.5, 2.5);
79
- } } }, { children: t('date_of_birth') })), _jsx(DatePicker, { defaultValue: dateValue ? new Date(dateValue) : new Date(), 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 })] })) })));
80
80
  });
81
81
  export default React.memo(IDNumber);
@@ -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('mobile_id_title'), description: t('mobile_id_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') })) }))] })) }))] }));
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);
@@ -74,6 +74,12 @@ var InputLabelStyled = styled(Text)(function (_a) {
74
74
  var theme = _a.theme;
75
75
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
76
76
  });
77
+ var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
78
+ var theme = _a.theme;
79
+ return ({
80
+ marginInlineStart: theme.spacing(1)
81
+ });
82
+ });
77
83
  var MobileNumber = React.forwardRef(function (_a, ref) {
78
84
  var _b;
79
85
  var countries = _a.countries, rest = __rest(_a, ["countries"]);
@@ -117,7 +123,7 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
117
123
  var mobileValue = phoneControl.field.value;
118
124
  var countryCodeValue = countryCodeControl.field.value;
119
125
  var error = (_b = phoneControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
120
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('mobile_number_label') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), _jsx(ExpandIcon, { anchorEl: !!anchorEl })] })), endAdornment: !error && mobileValue ? _jsx(CheckIcon, {}) : mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber }), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
126
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_enter_mobile') }), _jsx(Collapse, __assign({ in: !anchorEl }, { children: _jsx(Tooltip, __assign({ title: t('switch_to_id') }, { children: _jsx(IconStyled, { onClick: rest.onSwitchToIdNumber, alt: 'switcher icon', src: ICONS_NAMES.ID_IMAGE }) })) }))] }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits) || 10 }, onChange: onPhoneNumberChange, value: mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !error && mobileValue ? _jsx(CheckIcon, {}) : mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber }), placeholder: "".concat((countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.iso2) === 'SA' ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
121
127
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
122
128
  } }) }))] })) })));
123
129
  });
@@ -1,10 +1,14 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('DOB is required'),
4
- nid: yup.string().min(8).max(10).required('NID is required')
3
+ dob: yup.string().min(5).required('enter_valid_birth_date'),
4
+ nid: yup
5
+ .string()
6
+ .min(8, 'signup_invalid_national_id_format')
7
+ .max(10, 'signup_invalid_national_id_format')
8
+ .required('signup_invalid_national_id')
5
9
  });
6
10
  export var PhoneValidationSchema = function (min) {
7
11
  return yup.object().shape({
8
- mobile: yup.string().min(min).required('mobile_number_error')
12
+ mobile: yup.string().min(min, 'enter_valid_mobile_number').required('mobile_number_error')
9
13
  });
10
14
  };