@tap-payments/auth-jsconnect 1.0.11 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/locales/ar.json +200 -88
- package/build/assets/locales/en.json +216 -90
- package/build/components/DatePicker/DatePicker.js +6 -17
- package/build/components/ExpandIcon/ExpandIcon.d.ts +7 -0
- package/build/components/ExpandIcon/ExpandIcon.js +24 -0
- package/build/components/ExpandIcon/index.d.ts +2 -0
- package/build/components/ExpandIcon/index.js +2 -0
- package/build/components/Footer/Footer.js +1 -1
- package/build/components/Loader/Loader.js +2 -2
- package/build/components/Warning/Warning.d.ts +1 -2
- package/build/components/Warning/Warning.js +1 -2
- package/build/constants/app.d.ts +1 -1
- package/build/constants/app.js +32 -8
- package/build/constants/dummy.js +3 -3
- package/build/features/bank/screens/BankDetails/BankName.js +1 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +5 -5
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
- package/build/features/bank/screens/BankDetails/validation.js +9 -4
- package/build/features/bank/screens/Success/Success.d.ts +5 -0
- package/build/features/bank/screens/Success/Success.js +14 -0
- package/build/features/bank/screens/Success/index.d.ts +3 -0
- package/build/features/bank/screens/Success/index.js +2 -0
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -16
- package/build/features/business/screens/Activities/ActivitiesList.js +3 -17
- package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/Activities/validation.js +3 -3
- package/build/features/business/screens/BusinessType/CRNumber.js +2 -1
- package/build/features/business/screens/BusinessType/CompanyLicense.js +2 -2
- package/build/features/business/screens/BusinessType/FLNumber.js +2 -1
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +2 -2
- package/build/features/business/screens/BusinessType/SelectType.js +1 -1
- package/build/features/business/screens/BusinessType/validation.js +2 -8
- package/build/features/business/screens/Confirm/Confirm.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -24
- package/build/features/business/screens/Customers/CustomerLocations.js +3 -17
- package/build/features/business/screens/Customers/Customers.js +5 -41
- package/build/features/business/screens/Customers/ExpectedCustomers.js +7 -11
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
- package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
- package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
- package/build/features/business/screens/Customers/validation.d.ts +6 -6
- package/build/features/business/screens/Customers/validation.js +10 -5
- package/build/features/business/screens/IDBOD/DOB.js +3 -11
- package/build/features/business/screens/IDBOD/ID.js +1 -1
- package/build/features/business/screens/IDBOD/validation.js +7 -2
- package/build/features/business/screens/OTP/OTP.js +18 -58
- package/build/features/business/screens/OTP/OTPInput.js +9 -21
- package/build/features/business/screens/OTP/validation.js +1 -1
- package/build/features/business/screens/Success/Success.js +1 -2
- package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
- package/build/features/business/screens/VerifyNumber/OTPInput.js +13 -42
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
- package/build/features/business/screens/VerifyNumber/validation.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +7 -1
- package/build/features/connect/screens/Individual/Individual.js +0 -28
- package/build/features/connect/screens/Individual/Name.js +9 -3
- package/build/features/connect/screens/Individual/validation.js +5 -2
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +1 -0
- package/build/features/connect/screens/MID/BusinessCountry.js +2 -2
- package/build/features/connect/screens/MID/DOB.d.ts +6 -0
- package/build/features/connect/screens/MID/DOB.js +38 -0
- package/build/features/connect/screens/MID/IDNumber.js +3 -14
- package/build/features/connect/screens/MID/MID.js +13 -7
- package/build/features/connect/screens/MID/MobileNumber.d.ts +1 -0
- package/build/features/connect/screens/MID/MobileNumber.js +34 -10
- package/build/features/connect/screens/MID/validation.d.ts +1 -1
- package/build/features/connect/screens/MID/validation.js +9 -4
- package/build/features/connect/screens/Merchant/BrandName.js +3 -1
- package/build/features/connect/screens/Merchant/SocialMedia.js +7 -2
- package/build/features/connect/screens/Merchant/TAC.js +1 -1
- package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
- package/build/features/connect/screens/Merchant/validation.js +42 -11
- package/build/features/connect/screens/OTP/OTP.js +4 -3
- package/build/features/connect/screens/OTP/OTPInput.js +2 -1
- package/build/features/connect/screens/OTP/validation.js +1 -1
- package/build/features/connect/screens/Password/PasswordInput.js +2 -1
- package/build/features/connect/screens/Password/validation.js +1 -1
- package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
- package/build/features/featuresScreens.d.ts +1 -1
- package/build/features/featuresScreens.js +27 -7
- package/build/features/individual/Individual.d.ts +6 -0
- package/build/features/individual/Individual.js +50 -0
- package/build/features/individual/index.d.ts +1 -0
- package/build/features/individual/index.js +1 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +8 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +81 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +81 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +40 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +45 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +36 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +45 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +9 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +87 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/index.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/index.js +2 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +35 -0
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +19 -0
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +52 -0
- package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +3 -0
- package/build/features/individual/screens/ShowIndividualInfo/index.js +2 -0
- package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +7 -0
- package/build/features/individual/screens/ShowIndividualInfo/info.js +28 -0
- package/build/features/individual/screens/Success/Success.d.ts +5 -0
- package/build/features/individual/screens/Success/Success.js +14 -0
- package/build/features/individual/screens/Success/index.d.ts +3 -0
- package/build/features/individual/screens/Success/index.js +2 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +7 -2
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +6 -3
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +1 -1
- package/build/features/owner/screens/Success/Success.d.ts +5 -0
- package/build/features/owner/screens/Success/Success.js +14 -0
- package/build/features/owner/screens/Success/index.d.ts +3 -0
- package/build/features/owner/screens/Success/index.js +2 -0
- package/build/features/password/Password.js +2 -2
- package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +4 -1
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -8
- package/build/features/password/screens/CreatePassword/Password.js +2 -1
- package/build/features/password/screens/CreatePassword/validation.js +3 -3
- package/build/features/password/screens/Success/Success.d.ts +5 -0
- package/build/features/password/screens/Success/Success.js +14 -0
- package/build/features/password/screens/Success/index.d.ts +3 -0
- package/build/features/password/screens/Success/index.js +2 -0
- package/build/features/shared/Button/Button.js +7 -1
- package/build/features/shared/Footer/Footer.js +1 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -1
- package/build/features/tax/screens/Success/Success.d.ts +5 -0
- package/build/features/tax/screens/Success/Success.js +14 -0
- package/build/features/tax/screens/Success/index.d.ts +3 -0
- package/build/features/tax/screens/Success/index.js +2 -0
- package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
- package/build/features/tax/screens/TaxDetails/validation.js +1 -1
- package/build/index.css +105 -3
- package/build/index.d.ts +3 -3
- package/build/index.js +4 -4
- package/build/theme/typography.js +2 -2
- package/build/utils/string.js +2 -2
- package/package.json +120 -120
- package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
- package/build/features/business/screens/OTP/OTPTimer.js +0 -20
- package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
- package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
|
@@ -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 {
|
|
17
|
+
import { removeOnlyNumbers } 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 =
|
|
27
|
+
var value = removeOnlyNumbers(event.target.value);
|
|
26
28
|
nameControl.field.onChange(value);
|
|
27
29
|
};
|
|
28
30
|
var nameValue = nameControl.field.value;
|
|
29
|
-
|
|
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
|
|
4
|
-
|
|
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
|
});
|
|
@@ -32,7 +32,7 @@ import CheckIcon from '@mui/icons-material/Check';
|
|
|
32
32
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
33
33
|
import Icon from '../../../../components/Icon';
|
|
34
34
|
import Input from '../../../shared/Input';
|
|
35
|
-
import ExpandIcon from '
|
|
35
|
+
import ExpandIcon from '../../../../components/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('
|
|
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
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
14
|
+
import DatePicker from '../../../../components/DatePicker';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
17
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
18
|
+
import Text from '../../../../components/Text';
|
|
19
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
20
|
+
var theme = _a.theme;
|
|
21
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
22
|
+
});
|
|
23
|
+
var DOB = function (_a) {
|
|
24
|
+
var _b;
|
|
25
|
+
var onDateClicked = _a.onDateClicked;
|
|
26
|
+
var t = useTranslation().t;
|
|
27
|
+
var control = useFormContext().control;
|
|
28
|
+
var dobControl = useController({ control: control, name: 'dob' });
|
|
29
|
+
var handleBirthDateChange = function (data) {
|
|
30
|
+
dobControl.field.onChange(data);
|
|
31
|
+
};
|
|
32
|
+
var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
33
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
|
|
34
|
+
var spacing = _a.spacing;
|
|
35
|
+
return spacing(2.5, 2.5, 1.5, 2.5);
|
|
36
|
+
} } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { defaultValue: dateValue ? new Date(dateValue) : new Date(), readOnly: true, dir: 'ltr', locale: 'en', onDateChange: handleBirthDateChange, onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); } })] }));
|
|
37
|
+
};
|
|
38
|
+
export default DOB;
|
|
@@ -22,7 +22,6 @@ import Input from '../../../shared/Input';
|
|
|
22
22
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
23
23
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
24
24
|
import Collapse from '../../../../components/Collapse';
|
|
25
|
-
import DatePicker from '../../../../components/DatePicker';
|
|
26
25
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
27
26
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
28
27
|
import { ICONS_NAMES, ID_NUMBER_LENGTH } from '../../../../constants';
|
|
@@ -47,17 +46,14 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
47
46
|
});
|
|
48
47
|
});
|
|
49
48
|
var IDNumber = React.forwardRef(function (_a, ref) {
|
|
50
|
-
var _b
|
|
49
|
+
var _b;
|
|
51
50
|
var onSwitchToMobileNumber = _a.onSwitchToMobileNumber, show = _a.show;
|
|
52
51
|
var t = useTranslation().t;
|
|
53
|
-
var
|
|
52
|
+
var _c = useFormContext(), control = _c.control, setValue = _c.setValue;
|
|
54
53
|
var nidControl = useController({ control: control, name: 'nid' });
|
|
55
|
-
var dobControl = useController({ control: control, name: 'dob' });
|
|
56
54
|
React.useEffect(function () {
|
|
57
55
|
if (nidControl.field.value)
|
|
58
56
|
setValue('nid', nidControl.field.value, { shouldValidate: true });
|
|
59
|
-
if (dobControl.field.value)
|
|
60
|
-
setValue('dob', dobControl.field.value, { shouldValidate: true });
|
|
61
57
|
}, [show]);
|
|
62
58
|
var handleIdChange = function (_a) {
|
|
63
59
|
var target = _a.target;
|
|
@@ -67,15 +63,8 @@ var IDNumber = React.forwardRef(function (_a, ref) {
|
|
|
67
63
|
var clearIdNumber = function () {
|
|
68
64
|
nidControl.field.onChange('');
|
|
69
65
|
};
|
|
70
|
-
var handleBirthDateChange = function (data) {
|
|
71
|
-
dobControl.field.onChange(data);
|
|
72
|
-
};
|
|
73
66
|
var nidValue = nidControl.field.value;
|
|
74
67
|
var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
75
|
-
|
|
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) {
|
|
77
|
-
var spacing = _a.spacing;
|
|
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 })] })) })));
|
|
68
|
+
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 })] })) })));
|
|
80
69
|
});
|
|
81
70
|
export default React.memo(IDNumber);
|
|
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
19
|
import Collapse from '../../../../components/Collapse';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import Button from '
|
|
21
|
+
import Button from '../../../shared/Button';
|
|
22
22
|
import { useAppDispatch } from '../../../../hooks';
|
|
23
23
|
import { handleNextScreenStep } from '../../../../app/settings';
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
@@ -29,6 +29,7 @@ import IDNumber from './IDNumber';
|
|
|
29
29
|
import BusinessCountry from './BusinessCountry';
|
|
30
30
|
import { NIDValidationSchema, PhoneValidationSchema } from './validation';
|
|
31
31
|
import { countriesCode, defaultCountry, businessCountries } from '../../../../constants/dummy';
|
|
32
|
+
import DOB from './DOB';
|
|
32
33
|
var FormStyled = styled(Form)(function () { return ({
|
|
33
34
|
display: 'flex',
|
|
34
35
|
flexDirection: 'column'
|
|
@@ -50,17 +51,19 @@ var ListType;
|
|
|
50
51
|
ListType["CountryCodeList"] = "CountryCodeList";
|
|
51
52
|
})(ListType || (ListType = {}));
|
|
52
53
|
var MID = function (_a) {
|
|
53
|
-
var _b = React.useState(false),
|
|
54
|
-
var _c = React.useState(),
|
|
54
|
+
var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
|
|
55
|
+
var _c = React.useState(false), isNID = _c[0], setIsNID = _c[1];
|
|
56
|
+
var _d = React.useState(10), mobileLength = _d[0], setMobileLength = _d[1];
|
|
57
|
+
var _e = React.useState(), listType = _e[0], setListType = _e[1];
|
|
55
58
|
var dispatch = useAppDispatch();
|
|
56
59
|
var methods = useForm({
|
|
57
|
-
resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(
|
|
60
|
+
resolver: yupResolver(isNID ? NIDValidationSchema : PhoneValidationSchema(mobileLength)),
|
|
58
61
|
defaultValues: {
|
|
59
62
|
countryCode: defaultCountry,
|
|
60
63
|
businessCountry: defaultCountry,
|
|
61
64
|
nid: '',
|
|
62
|
-
dob: '',
|
|
63
|
-
mobile:
|
|
65
|
+
dob: '1998-08-22',
|
|
66
|
+
mobile: null
|
|
64
67
|
},
|
|
65
68
|
mode: 'onChange'
|
|
66
69
|
});
|
|
@@ -73,9 +76,12 @@ var MID = function (_a) {
|
|
|
73
76
|
console.log('data', data);
|
|
74
77
|
dispatch(handleNextScreenStep());
|
|
75
78
|
};
|
|
79
|
+
var handleCollapseOpenClose = function (flag) {
|
|
80
|
+
setCollapse(flag);
|
|
81
|
+
};
|
|
76
82
|
var isBusinessListActive = listType === ListType.BusinessList;
|
|
77
83
|
var isCountryListActive = listType === ListType.CountryCodeList;
|
|
78
84
|
var listActive = isBusinessListActive || isCountryListActive;
|
|
79
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(MIDTitle, { show: !listActive, title: t('
|
|
85
|
+
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(Collapse, __assign({ in: !collapse }, { children: _jsx(BusinessCountry, { show: !isCountryListActive, setMobileLength: setMobileLength, countries: businessCountries, onListOpen: function () { return handleMenuListClick(ListType.BusinessList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsx(Collapse, __assign({ in: !isNID }, { children: _jsx(MobileNumber, { show: !isBusinessListActive, setMobileLength: setMobileLength, countries: countriesCode, onSwitchToIdNumber: function () { return setIsNID(true); }, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) })), _jsxs(Collapse, __assign({ in: isNID }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !listActive, onSwitchToMobileNumber: function () { return setIsNID(false); } }) })), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(DOB, { onDateClicked: handleCollapseOpenClose }) }))] }))] })), _jsx(Collapse, __assign({ in: !listActive && !collapse }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) }))] }));
|
|
80
86
|
};
|
|
81
87
|
export default React.memo(MID);
|
|
@@ -29,11 +29,11 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
29
29
|
import Text from '../../../../components/Text';
|
|
30
30
|
import Collapse from '../../../../components/Collapse';
|
|
31
31
|
import Tooltip from '@mui/material/Tooltip';
|
|
32
|
-
import ExpandIcon from '../../../shared/ExpandIcon';
|
|
33
32
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
34
33
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
35
34
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
36
35
|
import Icon from '../../../../components/Icon';
|
|
36
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
37
37
|
import Input from '../../../shared/Input';
|
|
38
38
|
import SimpleList from '../../../../components/SimpleList';
|
|
39
39
|
import { ICONS_NAMES } from '../../../../constants';
|
|
@@ -58,9 +58,11 @@ var LabelContainerStyled = styled(Box)(function (_a) {
|
|
|
58
58
|
var CountryItemContainer = styled(Box)(function () { return ({
|
|
59
59
|
display: 'flex'
|
|
60
60
|
}); });
|
|
61
|
-
var CountryCodeText = styled(Text, {
|
|
61
|
+
var CountryCodeText = styled(Text, {
|
|
62
|
+
shouldForwardProp: function (prop) { return prop !== 'isSelected'; }
|
|
63
|
+
})(function (_a) {
|
|
62
64
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
63
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
65
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { width: theme.spacing(10), textAlign: 'start', fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
64
66
|
});
|
|
65
67
|
var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
66
68
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
@@ -74,24 +76,42 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
74
76
|
var theme = _a.theme;
|
|
75
77
|
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
76
78
|
});
|
|
79
|
+
var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
|
|
80
|
+
var theme = _a.theme;
|
|
81
|
+
return ({
|
|
82
|
+
marginInlineStart: theme.spacing(1)
|
|
83
|
+
});
|
|
84
|
+
});
|
|
77
85
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
78
|
-
var _b;
|
|
86
|
+
var _b, _c, _d;
|
|
79
87
|
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
80
88
|
var countriesCode = React.useState(countries)[0];
|
|
81
|
-
var
|
|
89
|
+
var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
|
|
82
90
|
var t = useTranslation().t;
|
|
83
91
|
var isAr = useLanguage().isAr;
|
|
84
|
-
var
|
|
92
|
+
var _f = useFormContext(), control = _f.control, setValue = _f.setValue, getValues = _f.getValues;
|
|
85
93
|
var phoneControl = useController({ name: 'mobile', control: control });
|
|
86
94
|
var countryCodeControl = useController({ name: 'countryCode', control: control });
|
|
95
|
+
var businessCountry = getValues('businessCountry');
|
|
87
96
|
React.useEffect(function () {
|
|
97
|
+
var _a;
|
|
88
98
|
if (phoneControl.field.value) {
|
|
89
99
|
setValue('mobile', phoneControl.field.value, { shouldValidate: true });
|
|
90
100
|
}
|
|
91
101
|
if (countryCodeControl.field.value) {
|
|
92
|
-
|
|
102
|
+
var country = countryCodeControl.field.value;
|
|
103
|
+
setValue('countryCode', country, { shouldValidate: true });
|
|
104
|
+
(_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
|
|
93
105
|
}
|
|
94
106
|
}, []);
|
|
107
|
+
React.useEffect(function () {
|
|
108
|
+
var _a;
|
|
109
|
+
var mobile = phoneControl.field.value;
|
|
110
|
+
if (mobile == null) {
|
|
111
|
+
setValue('countryCode', businessCountry);
|
|
112
|
+
(_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (businessCountry === null || businessCountry === void 0 ? void 0 : businessCountry.digits) || 10);
|
|
113
|
+
}
|
|
114
|
+
}, [businessCountry]);
|
|
95
115
|
var onPhoneNumberChange = function (_a) {
|
|
96
116
|
var target = _a.target;
|
|
97
117
|
var value = removeAllCharsFromNumber(target.value);
|
|
@@ -111,13 +131,17 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
111
131
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
112
132
|
};
|
|
113
133
|
var onSelectItem = function (country) {
|
|
134
|
+
var _a;
|
|
114
135
|
onCloseCountryList();
|
|
136
|
+
setValue('mobile', '');
|
|
137
|
+
(_a = rest.setMobileLength) === null || _a === void 0 ? void 0 : _a.call(rest, (country === null || country === void 0 ? void 0 : country.digits) || 10);
|
|
115
138
|
countryCodeControl.field.onChange(country);
|
|
116
139
|
};
|
|
117
|
-
var mobileValue = phoneControl.field.value;
|
|
118
140
|
var countryCodeValue = countryCodeControl.field.value;
|
|
119
|
-
var
|
|
120
|
-
|
|
141
|
+
var mobileValue = phoneControl.field.value || '';
|
|
142
|
+
var countryName = (isAr ? (_b = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.name) === null || _c === void 0 ? void 0 : _c.english) || '';
|
|
143
|
+
var error = (_d = phoneControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
|
|
144
|
+
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: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: onOpenCountryList }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { anchorEl: !!anchorEl })) : !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
145
|
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
146
|
} }) }))] })) })));
|
|
123
147
|
});
|
|
@@ -9,7 +9,7 @@ export declare const NIDValidationSchema: yup.ObjectSchema<import("yup/lib/objec
|
|
|
9
9
|
dob: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
10
|
nid: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
11
|
}>>>;
|
|
12
|
-
export declare const PhoneValidationSchema: (
|
|
12
|
+
export declare const PhoneValidationSchema: (length: number) => yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
13
|
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
14
14
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
15
15
|
mobile: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export var NIDValidationSchema = yup.object().shape({
|
|
3
|
-
dob: yup.string().min(5).required('
|
|
4
|
-
nid: yup
|
|
3
|
+
dob: yup.string().min(5).required('enter_valid_birth_date'),
|
|
4
|
+
nid: yup
|
|
5
|
+
.string()
|
|
6
|
+
.matches(/^(1)([0-9]{1,})$/g, 'signup_invalid_national_id_format')
|
|
7
|
+
.min(8, 'signup_invalid_national_id_format')
|
|
8
|
+
.max(10, 'signup_invalid_national_id_format')
|
|
9
|
+
.required('signup_invalid_national_id')
|
|
5
10
|
});
|
|
6
|
-
export var PhoneValidationSchema = function (
|
|
11
|
+
export var PhoneValidationSchema = function (length) {
|
|
7
12
|
return yup.object().shape({
|
|
8
|
-
mobile: yup.string().
|
|
13
|
+
mobile: yup.string().length(length, 'enter_valid_mobile_number').required('mobile_number_error')
|
|
9
14
|
});
|
|
10
15
|
};
|
|
@@ -23,6 +23,7 @@ import Input from '../../../shared/Input';
|
|
|
23
23
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
24
24
|
import Tooltip from '../../../../components/Tooltip';
|
|
25
25
|
import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
|
|
26
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
26
27
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
27
28
|
var theme = _a.theme;
|
|
28
29
|
return ({
|
|
@@ -68,6 +69,7 @@ var BrandName = function (_a) {
|
|
|
68
69
|
brandControl.field.onChange('');
|
|
69
70
|
};
|
|
70
71
|
var brandNameValue = brandControl.field.value;
|
|
71
|
-
|
|
72
|
+
var error = (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
73
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 3 } }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('signup_brand_name_label') }), _jsx(Tooltip, __assign({ title: t('brand_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(Input, { onChange: handleBrandNameChange, value: brandNameValue, placeholder: t('signup_brand_name_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && brandNameValue ? _jsx(CheckIcon, {}) : brandNameValue && _jsx(ClearIcon, { onClick: clearBrandName }) })] })));
|
|
72
74
|
};
|
|
73
75
|
export default React.memo(BrandName);
|
|
@@ -21,6 +21,7 @@ import Text from '../../../../components/Text';
|
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
22
|
import SocialMediaGroup from '../../../../components/SocialMediaGroup';
|
|
23
23
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
24
25
|
var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
|
|
25
26
|
var theme = _a.theme, defaultValue = _a.defaultValue;
|
|
26
27
|
return ({
|
|
@@ -32,6 +33,7 @@ var InputStyled = styled(Input)(function (_a) {
|
|
|
32
33
|
var theme = _a.theme;
|
|
33
34
|
return ({
|
|
34
35
|
padding: theme.spacing(0, 2, 0, 0),
|
|
36
|
+
paddingInlineEnd: theme.spacing(2),
|
|
35
37
|
input: {
|
|
36
38
|
paddingInlineStart: theme.spacing(0)
|
|
37
39
|
}
|
|
@@ -72,8 +74,11 @@ var SocialMedia = function (_a) {
|
|
|
72
74
|
var twitterValue = links.twitter || '';
|
|
73
75
|
var instagramValue = links.instagram || '';
|
|
74
76
|
var errors = linksControl.fieldState.error;
|
|
75
|
-
|
|
77
|
+
var websiteError = (_b = errors === null || errors === void 0 ? void 0 : errors.website) === null || _b === void 0 ? void 0 : _b.message;
|
|
78
|
+
var twitterError = (_c = errors === null || errors === void 0 ? void 0 : errors.twitter) === null || _c === void 0 ? void 0 : _c.message;
|
|
79
|
+
var instagramError = (_d = errors === null || errors === void 0 ? void 0 : errors.instagram) === null || _d === void 0 ? void 0 : _d.message;
|
|
80
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 3, direction: 'ltr' } }, { children: [_jsx(SocialMediaGroupStyled, { defaultValue: socialMediaType, exclusive: true, onChange: function (e, value) {
|
|
76
81
|
setSocialMediaType(value);
|
|
77
|
-
} }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, startAdornment: _jsx(TextStyled, { children: "https://" }),
|
|
82
|
+
} }), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.WEB, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: websiteValue, startAdornment: _jsx(TextStyled, { children: "https://" }), placeholder: t('signup_website_placeholder'), warningType: 'alert', warningMessage: websiteError && t(websiteError), endAdornment: !websiteError && websiteValue ? _jsx(CheckIcon, {}) : websiteValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.TWITTER, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: twitterValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_twitter_placeholder'), warningType: 'alert', warningMessage: twitterError && t(twitterError), endAdornment: !twitterError && twitterValue ? _jsx(CheckIcon, {}) : twitterValue && _jsx(ClearIconStyled, { onClick: handleClear }) }) })), _jsx(Collapse, __assign({ in: socialMediaType === SocialMediaTypes.INSTAGRAM, timeout: 300 }, { children: _jsx(InputStyled, { onChange: handleChange, value: instagramValue, startAdornment: _jsx(TextStyled, { children: "@" }), placeholder: t('signup_instagram_placeholder'), warningType: 'alert', warningMessage: instagramError && t(instagramError), endAdornment: !instagramError && instagramValue ? (_jsx(CheckIcon, {})) : (instagramValue && _jsx(ClearIconStyled, { onClick: handleClear })) }) }))] })));
|
|
78
83
|
};
|
|
79
84
|
export default React.memo(SocialMedia);
|
|
@@ -74,6 +74,6 @@ var TAC = function (_a) {
|
|
|
74
74
|
var handleTACCheckedChange = function (event, checked) {
|
|
75
75
|
tacControl.field.onChange(checked);
|
|
76
76
|
};
|
|
77
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TOS_AR : EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] })));
|
|
77
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TOS_AR : EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
|
|
78
78
|
};
|
|
79
79
|
export default React.memo(TAC);
|
|
@@ -3,15 +3,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
|
|
|
3
3
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
5
5
|
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
|
-
website:
|
|
6
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
7
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
8
8
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
9
9
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
-
website:
|
|
10
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
11
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
12
12
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
13
13
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
14
|
-
website:
|
|
14
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
15
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
16
16
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
17
17
|
}>>>;
|
|
@@ -19,15 +19,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
|
|
|
19
19
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
20
20
|
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
21
21
|
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
22
|
-
website:
|
|
22
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
23
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
24
24
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
25
25
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
26
|
-
website:
|
|
26
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
27
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
28
28
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
29
29
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
30
|
-
website:
|
|
30
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
31
31
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
32
32
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
33
33
|
}>>>;
|
|
@@ -35,15 +35,15 @@ export declare const MerchantValidationSchema: yup.ObjectSchema<import("yup/lib/
|
|
|
35
35
|
brandName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
36
36
|
termAndConditionChecked: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
37
37
|
links: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
|
-
website:
|
|
38
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
39
39
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
40
40
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
41
41
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
42
|
-
website:
|
|
42
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
43
43
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
44
44
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
45
45
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
46
|
-
website:
|
|
46
|
+
website: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
47
47
|
instagram: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
48
48
|
twitter: yup.StringSchema<string | null | undefined, import("yup/lib/types").AnyObject, string | null | undefined>;
|
|
49
49
|
}>>>;
|