@tap-payments/auth-jsconnect 1.0.10 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +5 -0
- package/build/assets/locales/ar.json +190 -72
- package/build/assets/locales/en.json +207 -75
- package/build/components/AnimationFlow/Dialog.js +12 -1
- package/build/components/DatePicker/DatePicker.d.ts +3 -1
- package/build/components/DatePicker/DatePicker.js +8 -5
- package/build/components/Loader/Loader.js +2 -2
- package/build/components/Radio/Radio.d.ts +5 -0
- package/build/components/Radio/Radio.js +31 -0
- package/build/components/Radio/index.d.ts +3 -0
- package/build/components/Radio/index.js +2 -0
- package/build/components/RadioGroup/RadioGroup.d.ts +5 -0
- package/build/components/RadioGroup/RadioGroup.js +41 -0
- package/build/components/RadioGroup/index.d.ts +3 -0
- package/build/components/RadioGroup/index.js +2 -0
- package/build/components/RadioLabel/RadioLabel.d.ts +7 -0
- package/build/components/RadioLabel/RadioLabel.js +34 -0
- package/build/components/RadioLabel/index.d.ts +3 -0
- package/build/components/RadioLabel/index.js +2 -0
- package/build/constants/app.js +19 -7
- package/build/constants/dummy.d.ts +5 -0
- package/build/constants/dummy.js +8 -0
- package/build/features/bank/Bank.js +1 -1
- package/build/features/bank/screens/BankDetails/BankName.js +1 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +3 -3
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
- package/build/features/bank/screens/BankDetails/validation.js +8 -3
- 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/Business.js +1 -1
- package/build/features/business/screens/Activities/Activities.js +14 -40
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +6 -0
- package/build/features/business/screens/Activities/OperationStartDate.js +31 -0
- package/build/features/business/screens/Activities/SalesChannels.js +3 -10
- package/build/features/business/screens/Activities/validation.d.ts +3 -0
- package/build/features/business/screens/Activities/validation.js +3 -2
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -2
- package/build/features/business/screens/BusinessType/CRNumber.js +1 -1
- package/build/features/business/screens/BusinessType/CompanyLicense.js +1 -1
- package/build/features/business/screens/BusinessType/FLNumber.js +1 -1
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +1 -1
- package/build/features/business/screens/BusinessType/SelectType.js +1 -1
- package/build/features/business/screens/Confirm/Confirm.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +5 -41
- package/build/features/business/screens/Customers/ExpectedCustomers.js +4 -10
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +5 -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.d.ts +2 -1
- package/build/features/business/screens/IDBOD/DOB.js +4 -1
- package/build/features/business/screens/IDBOD/ID.js +7 -48
- package/build/features/business/screens/IDBOD/IDBOD.js +9 -41
- package/build/features/business/screens/IDBOD/validation.js +6 -2
- package/build/features/business/screens/OTP/OTP.js +18 -58
- package/build/features/business/screens/OTP/OTPInput.js +8 -21
- 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 +12 -42
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
- package/build/features/connect/Connect.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.js +4 -4
- package/build/features/connect/screens/MID/IDNumber.js +9 -6
- package/build/features/connect/screens/MID/MID.js +2 -2
- package/build/features/connect/screens/MID/MobileNumber.js +13 -15
- package/build/features/connect/screens/MID/validation.d.ts +1 -1
- package/build/features/connect/screens/MID/validation.js +11 -5
- package/build/features/connect/screens/Merchant/BrandName.js +5 -3
- package/build/features/connect/screens/Merchant/SocialMedia.js +6 -1
- package/build/features/connect/screens/Merchant/TAC.js +2 -2
- 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 +1 -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 +32 -7
- package/build/features/owner/Owner.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +8 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +77 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +10 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +80 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +6 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +40 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +6 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +45 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +6 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +35 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +6 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +45 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +9 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +85 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +3 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/index.js +2 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +25 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +35 -0
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +2 -2
- 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 +3 -3
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +2 -1
- 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/ExpandIcon/ExpandIcon.js +1 -1
- package/build/features/shared/Input/Input.d.ts +0 -1
- package/build/features/shared/Input/Input.js +2 -5
- package/build/features/shared/Mandatory/Mandatory.d.ts +2 -0
- package/build/features/shared/Mandatory/Mandatory.js +20 -0
- package/build/features/shared/Mandatory/index.d.ts +2 -0
- package/build/features/shared/Mandatory/index.js +2 -0
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -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/theme/typography.js +2 -2
- package/build/utils/string.js +2 -2
- package/build/utils/validation.d.ts +2 -0
- package/build/utils/validation.js +6 -0
- package/package.json +1 -1
- 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
|
@@ -29,12 +29,12 @@ 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
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import ScreenContainer from '
|
|
32
|
+
import ExpandIcon from '../../../shared/ExpandIcon';
|
|
33
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
34
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
35
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
36
36
|
import Icon from '../../../../components/Icon';
|
|
37
|
-
import Input from '
|
|
37
|
+
import Input from '../../../shared/Input';
|
|
38
38
|
import SimpleList from '../../../../components/SimpleList';
|
|
39
39
|
import { ICONS_NAMES } from '../../../../constants';
|
|
40
40
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
@@ -66,14 +66,6 @@ var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return
|
|
|
66
66
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
67
67
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
68
68
|
});
|
|
69
|
-
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
70
|
-
var theme = _a.theme;
|
|
71
|
-
return ({
|
|
72
|
-
color: theme.palette.success.main,
|
|
73
|
-
display: 'flex',
|
|
74
|
-
alignItems: 'flex-end'
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
69
|
var CountryCodeStyled = styled(Text)(function (_a) {
|
|
78
70
|
var theme = _a.theme;
|
|
79
71
|
return (__assign(__assign({ cursor: 'pointer' }, theme.typography.body2), { fontWeight: theme.typography.fontWeightRegular, display: 'flex', alignItems: 'center', minWidth: theme.spacing(8.75) }));
|
|
@@ -82,6 +74,12 @@ var InputLabelStyled = styled(Text)(function (_a) {
|
|
|
82
74
|
var theme = _a.theme;
|
|
83
75
|
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6), fontWeight: theme.typography.fontWeightMedium }, theme.typography.caption), { lineHeight: theme.spacing(2.5) }));
|
|
84
76
|
});
|
|
77
|
+
var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
|
|
78
|
+
var theme = _a.theme;
|
|
79
|
+
return ({
|
|
80
|
+
marginInlineStart: theme.spacing(1)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
85
83
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
86
84
|
var _b;
|
|
87
85
|
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
@@ -125,8 +123,8 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
125
123
|
var mobileValue = phoneControl.field.value;
|
|
126
124
|
var countryCodeValue = countryCodeControl.field.value;
|
|
127
125
|
var error = (_b = phoneControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
128
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: t('
|
|
129
|
-
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(
|
|
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) {
|
|
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, {})] }));
|
|
130
128
|
} }) }))] })) })));
|
|
131
129
|
});
|
|
132
130
|
export default React.memo(MobileNumber);
|
|
@@ -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: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
12
|
+
export declare const PhoneValidationSchema: (min: 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,8 +1,14 @@
|
|
|
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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')
|
|
8
9
|
});
|
|
10
|
+
export var PhoneValidationSchema = function (min) {
|
|
11
|
+
return yup.object().shape({
|
|
12
|
+
mobile: yup.string().min(min, 'enter_valid_mobile_number').required('mobile_number_error')
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -22,7 +22,8 @@ import Text from '../../../../components/Text';
|
|
|
22
22
|
import Input from '../../../shared/Input';
|
|
23
23
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
24
24
|
import Tooltip from '../../../../components/Tooltip';
|
|
25
|
-
import {
|
|
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 ({
|
|
@@ -61,13 +62,14 @@ var BrandName = function (_a) {
|
|
|
61
62
|
var brandControl = useController({ control: control, name: 'brandName' });
|
|
62
63
|
var handleBrandNameChange = function (_a) {
|
|
63
64
|
var target = _a.target;
|
|
64
|
-
var value =
|
|
65
|
+
var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
|
|
65
66
|
brandControl.field.onChange(value);
|
|
66
67
|
};
|
|
67
68
|
var clearBrandName = function () {
|
|
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;
|
|
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;
|
|
75
80
|
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 3 } }, { 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);
|
|
@@ -52,7 +52,7 @@ var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
|
52
52
|
marginInlineEnd: theme.spacing(1.5),
|
|
53
53
|
color: theme.palette.primary.main,
|
|
54
54
|
'& .MuiSvgIcon-root': {
|
|
55
|
-
fontSize:
|
|
55
|
+
fontSize: theme.spacing(3.75)
|
|
56
56
|
},
|
|
57
57
|
'&.Mui-checked': {
|
|
58
58
|
color: theme.palette.text.primary,
|
|
@@ -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
|
}>>>;
|
|
@@ -1,23 +1,54 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export var MerchantValidationSchema = yup.object().shape({
|
|
3
|
-
brandName: yup.string().min(3, '
|
|
4
|
-
termAndConditionChecked: yup.boolean().required().isTrue('
|
|
3
|
+
brandName: yup.string().min(3, 'enter_brand_name_english_chars_numbers_space').required('enter_valid_brand_name'),
|
|
4
|
+
termAndConditionChecked: yup.boolean().required().isTrue('check_terms_cond'),
|
|
5
5
|
links: yup.object().shape({
|
|
6
|
-
website: yup
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
website: yup.string().when(['instagram', 'twitter'], function (instagram, twitter) {
|
|
7
|
+
if (!instagram && !twitter) {
|
|
8
|
+
return yup
|
|
9
|
+
.string()
|
|
10
|
+
.matches(/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/, 'ide_not_valid_url')
|
|
11
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
12
|
+
.nullable()
|
|
13
|
+
.required('enter_at_least_one');
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return yup
|
|
17
|
+
.string()
|
|
18
|
+
.matches(/(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/, 'ide_not_valid_url')
|
|
19
|
+
.transform(function (value) { return (!!value ? value : null); })
|
|
20
|
+
.nullable()
|
|
21
|
+
.optional();
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
10
24
|
instagram: yup
|
|
11
25
|
.string()
|
|
12
|
-
.notRequired()
|
|
13
26
|
.nullable()
|
|
14
27
|
.transform(function (value) { return (!!value ? value : null); })
|
|
15
|
-
.
|
|
28
|
+
.when(['twitter', 'website'], function (twitter, website) {
|
|
29
|
+
if (!website && !twitter) {
|
|
30
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return yup.string().optional();
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
16
36
|
twitter: yup
|
|
17
37
|
.string()
|
|
18
|
-
.notRequired()
|
|
19
38
|
.nullable()
|
|
20
39
|
.transform(function (value) { return (!!value ? value : null); })
|
|
21
|
-
.min(2, '
|
|
22
|
-
|
|
40
|
+
.min(2, 'enter_at_least_one')
|
|
41
|
+
.when(['website', 'instagram'], function (website, instagram) {
|
|
42
|
+
if (!website && !instagram) {
|
|
43
|
+
return yup.string().min(2, 'enter_at_least_one').required('enter_at_least_one');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return yup.string().optional();
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
}, [
|
|
50
|
+
['instagram', 'website'],
|
|
51
|
+
['twitter', 'website'],
|
|
52
|
+
['instagram', 'twitter']
|
|
53
|
+
])
|
|
23
54
|
});
|
|
@@ -34,12 +34,12 @@ var OTPTitleContainerStyled = styled(Box)(function (_a) {
|
|
|
34
34
|
borderColor: theme.palette.divider,
|
|
35
35
|
direction: theme.direction,
|
|
36
36
|
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
37
|
-
marginBottom: theme.spacing(
|
|
37
|
+
marginBottom: theme.spacing(5.75)
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
var OTPTitleStyled = styled(Text)(function (_a) {
|
|
41
41
|
var theme = _a.theme;
|
|
42
|
-
return (__assign(__assign({}, theme.typography.
|
|
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 }));
|
|
43
43
|
});
|
|
44
44
|
var FormStyled = styled(Form)(function () { return ({
|
|
45
45
|
display: 'flex',
|
|
@@ -63,7 +63,8 @@ var OTP = function (_a) {
|
|
|
63
63
|
return dispatch(handleNextScreenStep('CONNECT_PASSWORD_STEP'));
|
|
64
64
|
dispatch(handleNextScreenStep('CONNECT_INDIVIDUAL_STEP'));
|
|
65
65
|
};
|
|
66
|
-
|
|
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: maskPhone(phone) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', isAr: isAr, loading: loading }, { children: t('next') }))] })) })) }));
|
|
67
68
|
};
|
|
68
69
|
OTP.defaultProps = {
|
|
69
70
|
phone: '+996564656085'
|
|
@@ -33,6 +33,6 @@ var OTPInput = function (_a) {
|
|
|
33
33
|
otpControl.field.onChange(otp);
|
|
34
34
|
};
|
|
35
35
|
var otpValue = otpControl.field.value;
|
|
36
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('
|
|
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()); } }) })));
|
|
37
37
|
};
|
|
38
38
|
export default React.memo(OTPInput);
|
|
@@ -33,6 +33,7 @@ var PasswordInput = function (_a) {
|
|
|
33
33
|
setShowPassword(false);
|
|
34
34
|
};
|
|
35
35
|
var passwordValue = passwordControl.field.value;
|
|
36
|
-
|
|
36
|
+
var error = (_b = passwordControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
37
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 5 } }, { children: _jsx(Input, { label: t('tap_js_password_description'), inputProps: { autoComplete: 'off' }, onChange: handlePasswordChange, value: passwordValue, endAdornment: _jsx(PasswordIcon, { show: showPassword, onShow: handleShowPassword, onHide: handleHidePassword }), placeholder: t('tap_js_password_placeholder'), type: showPassword ? 'text' : 'password', warningType: 'alert', warningMessage: error && t(error, { length: 5 }) }) })));
|
|
37
38
|
};
|
|
38
39
|
export default React.memo(PasswordInput);
|
|
@@ -8,8 +8,7 @@ var ThankYou = 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('
|
|
12
|
+
return _jsx(SuccessScreen, { title: t('ide_successfully_verified_message'), onSuccess: onSuccess });
|
|
14
13
|
};
|
|
15
14
|
export default React.memo(ThankYou);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FeatureScreenStep } from '../@types';
|
|
2
2
|
export declare const connectFeatureScreens: Array<FeatureScreenStep>;
|
|
3
3
|
export declare const businessFeatureScreens: Array<FeatureScreenStep>;
|
|
4
|
-
export declare const ownerFeatureScreens: Array<FeatureScreenStep>;
|
|
5
4
|
export declare const passwordFeatureScreens: Array<FeatureScreenStep>;
|
|
5
|
+
export declare const ownerFeatureScreens: Array<FeatureScreenStep>;
|
|
6
6
|
export declare const bankFeatureScreens: Array<FeatureScreenStep>;
|
|
7
7
|
export declare const taxFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -13,9 +13,14 @@ import ActivitiesPage from './business/screens/Activities';
|
|
|
13
13
|
import SuccessPage from './business/screens/Success';
|
|
14
14
|
import ConfirmPage from './business/screens/Confirm';
|
|
15
15
|
import CreatePasswordPage from './password/screens/CreatePassword';
|
|
16
|
+
import SuccessPasswordPage from './password/screens/Success';
|
|
16
17
|
import ShowOwnerInfoPage from './owner/screens/ShowOwnerInfo';
|
|
18
|
+
import AdditionalOwnerInfoPage from './owner/screens/AdditionalOwnerInfo';
|
|
19
|
+
import SuccessOwnerPage from './owner/screens/Success';
|
|
17
20
|
import BankDetailsPage from './bank/screens/BankDetails';
|
|
21
|
+
import BankSuccessPage from './bank/screens/Success';
|
|
18
22
|
import TaxDetailsPage from './tax/screens/TaxDetails';
|
|
23
|
+
import TaxSuccessPage from './tax/screens/Success';
|
|
19
24
|
export var connectFeatureScreens = [
|
|
20
25
|
{
|
|
21
26
|
name: 'CONNECT_MID_STEP',
|
|
@@ -73,27 +78,47 @@ export var businessFeatureScreens = [
|
|
|
73
78
|
},
|
|
74
79
|
{ name: 'BUSINESS_SUCCESS_STEP', element: SuccessPage }
|
|
75
80
|
];
|
|
81
|
+
export var passwordFeatureScreens = [
|
|
82
|
+
{
|
|
83
|
+
name: 'PASSWORD_CREATE_PASSWORD_STEP',
|
|
84
|
+
element: CreatePasswordPage
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'PASSWORD_SUCCESS_STEP',
|
|
88
|
+
element: SuccessPasswordPage
|
|
89
|
+
}
|
|
90
|
+
];
|
|
76
91
|
export var ownerFeatureScreens = [
|
|
77
92
|
{
|
|
78
93
|
name: 'OWNER_SHOW_OWNER_INFO_STEP',
|
|
79
94
|
element: ShowOwnerInfoPage
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
|
-
export var passwordFeatureScreens = [
|
|
95
|
+
},
|
|
83
96
|
{
|
|
84
|
-
name: '
|
|
85
|
-
element:
|
|
97
|
+
name: 'OWNER_ADDITIONAL_OWNER_INFO_STEP',
|
|
98
|
+
element: AdditionalOwnerInfoPage
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: 'OWNER_SUCCESS_STEP',
|
|
102
|
+
element: SuccessOwnerPage
|
|
86
103
|
}
|
|
87
104
|
];
|
|
88
105
|
export var bankFeatureScreens = [
|
|
89
106
|
{
|
|
90
|
-
name: '
|
|
107
|
+
name: 'BANK_BANK_DETAILS_STEP',
|
|
91
108
|
element: BankDetailsPage
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'BANK_DETAILS_SUCCESS_STEP',
|
|
112
|
+
element: BankSuccessPage
|
|
92
113
|
}
|
|
93
114
|
];
|
|
94
115
|
export var taxFeatureScreens = [
|
|
95
116
|
{
|
|
96
|
-
name: '
|
|
117
|
+
name: 'TAX_TAX_DETAILS_STEP',
|
|
97
118
|
element: TaxDetailsPage
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'TAX_DETAILS_SUCCESS_STEP',
|
|
122
|
+
element: TaxSuccessPage
|
|
98
123
|
}
|
|
99
124
|
];
|
|
@@ -36,7 +36,7 @@ var Owner = memo(function (props) {
|
|
|
36
36
|
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: ownerFeatureScreens.map(function (_a, index) {
|
|
37
37
|
var Element = _a.element, name = _a.name;
|
|
38
38
|
var isActive = activeScreen.name === name;
|
|
39
|
-
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter:
|
|
39
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
40
40
|
}) }) })) })));
|
|
41
41
|
});
|
|
42
42
|
export function OwnerLib(props) {
|
|
@@ -0,0 +1,77 @@
|
|
|
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 * as React from 'react';
|
|
14
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
15
|
+
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
|
+
import Box from '@mui/material/Box';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
19
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
20
|
+
import { styled } from '@mui/material/styles';
|
|
21
|
+
import Form from '../../../../components/Form';
|
|
22
|
+
import Collapse from '../../../../components/Collapse';
|
|
23
|
+
import Button from '../../../shared/Button';
|
|
24
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
25
|
+
import { useLanguage } from '../../../../hooks';
|
|
26
|
+
import PEPSwitch from './PEPSwitch';
|
|
27
|
+
import { OwnerInfoValidationSchema } from './validation';
|
|
28
|
+
import InfluencerSwitch from './InfluencerSwitch';
|
|
29
|
+
import MonthlyIncome from './MonthlyIncome';
|
|
30
|
+
import EmployerName from './EmployerName';
|
|
31
|
+
import EmployerLocation from './EmployerLocation';
|
|
32
|
+
import SourceOfIncome from './SourceOfIncome';
|
|
33
|
+
import { countriesCode, SOURCE_OF_INCOME } from '../../../../constants';
|
|
34
|
+
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
35
|
+
var _b;
|
|
36
|
+
var theme = _a.theme, listActive = _a.listActive;
|
|
37
|
+
return (_b = {
|
|
38
|
+
paddingBottom: theme.spacing(listActive ? 0 : 5),
|
|
39
|
+
overflow: 'hidden',
|
|
40
|
+
maxHeight: 'calc(100vh - 250px)'
|
|
41
|
+
},
|
|
42
|
+
_b[theme.transitions.create(['padding-bottom'])] = {
|
|
43
|
+
duration: theme.transitions.duration.standard
|
|
44
|
+
},
|
|
45
|
+
_b);
|
|
46
|
+
});
|
|
47
|
+
var AdditionalOwnerInfo = function (_a) {
|
|
48
|
+
var methods = useForm({
|
|
49
|
+
resolver: yupResolver(OwnerInfoValidationSchema),
|
|
50
|
+
defaultValues: {
|
|
51
|
+
monthlyIncome: '',
|
|
52
|
+
employerName: '',
|
|
53
|
+
isPEP: null,
|
|
54
|
+
isInfluencer: null
|
|
55
|
+
},
|
|
56
|
+
mode: 'onChange'
|
|
57
|
+
});
|
|
58
|
+
var t = useTranslation().t;
|
|
59
|
+
var isAr = useLanguage().isAr;
|
|
60
|
+
var dispatch = useAppDispatch();
|
|
61
|
+
var _b = React.useState(false), listActive = _b[0], setListActive = _b[1];
|
|
62
|
+
var _c = React.useState(false), employerFieldsActive = _c[0], setEmployerFieldsActive = _c[1];
|
|
63
|
+
var onSubmit = function (data) {
|
|
64
|
+
console.log('data', data);
|
|
65
|
+
dispatch(handleNextScreenStep());
|
|
66
|
+
};
|
|
67
|
+
var handleSelectSource = function (country) {
|
|
68
|
+
var _a;
|
|
69
|
+
if (((_a = country.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary')
|
|
70
|
+
setEmployerFieldsActive(true);
|
|
71
|
+
else
|
|
72
|
+
setEmployerFieldsActive(false);
|
|
73
|
+
};
|
|
74
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SourceOfIncome, { show: !listActive, list: SOURCE_OF_INCOME, onSelectSource: handleSelectSource }), _jsx(MonthlyIncome, { show: !listActive }), _jsx(EmployerName, { show: !listActive && employerFieldsActive }), _jsx(EmployerLocation, { show: employerFieldsActive, countries: countriesCode, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) })) }));
|
|
75
|
+
};
|
|
76
|
+
export default React.memo(AdditionalOwnerInfo);
|
|
77
|
+
AdditionalOwnerInfo.defaultProps = {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CountryCode } from '../../../../@types';
|
|
3
|
+
interface EmployerLocationProps {
|
|
4
|
+
countries: Array<CountryCode>;
|
|
5
|
+
show: boolean;
|
|
6
|
+
onListOpen?: () => void;
|
|
7
|
+
onListClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<EmployerLocationProps & React.RefAttributes<unknown>>>;
|
|
10
|
+
export default _default;
|