@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
|
@@ -0,0 +1,45 @@
|
|
|
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 { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useFormContext, useController } from 'react-hook-form';
|
|
16
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
17
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
18
|
+
import Collapse from '../../../../components/Collapse';
|
|
19
|
+
import Mandatory from '../../../shared/Mandatory';
|
|
20
|
+
import Text from '../../../../components/Text';
|
|
21
|
+
import RadioGroup from '../../../../components/RadioGroup';
|
|
22
|
+
import RadioLabel from '../../../../components/RadioLabel';
|
|
23
|
+
var LabelTextStyled = styled(Text)(function (_a) {
|
|
24
|
+
var theme = _a.theme;
|
|
25
|
+
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
|
|
26
|
+
});
|
|
27
|
+
var RadioGroupStyled = styled(RadioGroup)(function (_a) {
|
|
28
|
+
var theme = _a.theme;
|
|
29
|
+
return ({
|
|
30
|
+
marginInlineStart: theme.spacing(0.25)
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
var PEPSwitch = function (_a) {
|
|
34
|
+
var show = _a.show;
|
|
35
|
+
var control = useFormContext().control;
|
|
36
|
+
var t = useTranslation().t;
|
|
37
|
+
var pepControl = useController({ name: 'isPEP', control: control });
|
|
38
|
+
var handleOnChange = function (_a) {
|
|
39
|
+
var target = _a.target;
|
|
40
|
+
pepControl.field.onChange(target.value === 'yes');
|
|
41
|
+
};
|
|
42
|
+
var pepValue = pepControl.field.value;
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
44
|
+
};
|
|
45
|
+
export default React.memo(PEPSwitch);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SourceOfIncome as SourceOfIncomeType } from '../../../../@types';
|
|
3
|
+
interface SourceOfIncomeProps {
|
|
4
|
+
list: Array<SourceOfIncomeType>;
|
|
5
|
+
show: boolean;
|
|
6
|
+
onSelectSource?: (country: SourceOfIncomeType) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: React.MemoExoticComponent<({ list, ...rest }: SourceOfIncomeProps) => JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import * as React from 'react';
|
|
25
|
+
import Box from '@mui/material/Box';
|
|
26
|
+
import { styled } from '@mui/material/styles';
|
|
27
|
+
import { useTranslation } from 'react-i18next';
|
|
28
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
29
|
+
import Text from '../../../../components/Text';
|
|
30
|
+
import Collapse from '../../../../components/Collapse';
|
|
31
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
32
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
33
|
+
import Input from '../../../shared/Input';
|
|
34
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
35
|
+
import SimpleList from '../../../../components/SimpleList';
|
|
36
|
+
import { useLanguage } from '../../../../hooks';
|
|
37
|
+
var Container = styled(Box)(function () { return ({
|
|
38
|
+
display: 'flex'
|
|
39
|
+
}); });
|
|
40
|
+
var SimpleListStyled = styled((SimpleList))(function (_a) {
|
|
41
|
+
var theme = _a.theme;
|
|
42
|
+
return ({
|
|
43
|
+
height: 'fit-content',
|
|
44
|
+
backgroundColor: theme.palette.common.white,
|
|
45
|
+
borderBottom: "".concat(theme.spacing(0.125), " solid ").concat(theme.palette.divider)
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
49
|
+
var theme = _a.theme, isSelected = _a.isSelected;
|
|
50
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
51
|
+
});
|
|
52
|
+
var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
53
|
+
var theme = _a.theme;
|
|
54
|
+
return ({
|
|
55
|
+
color: theme.palette.success.main,
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'flex-end'
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
var SourceOfIncome = function (_a) {
|
|
61
|
+
var _b;
|
|
62
|
+
var list = _a.list, rest = __rest(_a, ["list"]);
|
|
63
|
+
var sourceList = React.useState(list)[0];
|
|
64
|
+
var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
65
|
+
var t = useTranslation().t;
|
|
66
|
+
var isAr = useLanguage().isAr;
|
|
67
|
+
var control = useFormContext().control;
|
|
68
|
+
var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
|
|
69
|
+
var onOpenList = function (event) {
|
|
70
|
+
setAnchorEl(event.currentTarget);
|
|
71
|
+
};
|
|
72
|
+
var onCloseList = function () {
|
|
73
|
+
setAnchorEl(null);
|
|
74
|
+
};
|
|
75
|
+
var onSelectItem = function (country) {
|
|
76
|
+
var _a;
|
|
77
|
+
onCloseList();
|
|
78
|
+
(_a = rest.onSelectSource) === null || _a === void 0 ? void 0 : _a.call(rest, country);
|
|
79
|
+
sourceIncomeControl.field.onChange(country);
|
|
80
|
+
};
|
|
81
|
+
var source = sourceIncomeControl.field.value;
|
|
82
|
+
var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name : source === null || source === void 0 ? void 0 : source.nameEn) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
84
|
+
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name : item === null || item === void 0 ? void 0 : item.nameEn })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
|
|
85
|
+
} }) }))] })) })));
|
|
86
|
+
};
|
|
87
|
+
export default React.memo(SourceOfIncome);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
import { ObjectShape } from 'yup/lib/object';
|
|
3
|
+
import { CountryCode } from '../../../../@types';
|
|
4
|
+
export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
|
|
5
|
+
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
6
|
+
monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
7
|
+
employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
8
|
+
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
9
|
+
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
12
|
+
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
13
|
+
monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
+
employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
|
+
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
16
|
+
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
17
|
+
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
18
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
|
|
19
|
+
sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
|
|
20
|
+
monthlyIncome: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
+
employerName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
|
+
employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
|
|
23
|
+
isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
24
|
+
isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
|
|
25
|
+
}>>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var IndividualInfoValidationSchema = yup.object().shape({
|
|
3
|
+
sourceIncome: yup.object().required('choose_any_source_of_income'),
|
|
4
|
+
monthlyIncome: yup.string().optional(),
|
|
5
|
+
employerName: yup.string().when('sourceIncome', function (sourceIncomeValue) {
|
|
6
|
+
var _a;
|
|
7
|
+
if (((_a = sourceIncomeValue === null || sourceIncomeValue === void 0 ? void 0 : sourceIncomeValue.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary') {
|
|
8
|
+
return yup
|
|
9
|
+
.string()
|
|
10
|
+
.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, 'employer_name_invalid')
|
|
11
|
+
.required('please_enter_employer_name');
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return yup.string().optional();
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
employerLocation: yup.object().when('sourceIncome', function (sourceIncome) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (((_a = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary') {
|
|
20
|
+
return yup
|
|
21
|
+
.object({
|
|
22
|
+
name: yup.object().shape({
|
|
23
|
+
arabic: yup.string().required('please_choose_employer_location'),
|
|
24
|
+
english: yup.string().required('please_choose_employer_location')
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
.required('please_choose_employer_location');
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return yup.object().optional();
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
isPEP: yup.boolean().required('please_choose_relative_pep'),
|
|
34
|
+
isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
|
|
35
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ShowOwnerInfoProps {
|
|
3
|
+
citizenship: string;
|
|
4
|
+
nationalAddr: string;
|
|
5
|
+
birthDate: string;
|
|
6
|
+
placeOfBirth: string;
|
|
7
|
+
maritalStatus: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.MemoExoticComponent<{
|
|
10
|
+
({ citizenship, nationalAddr, birthDate, placeOfBirth, maritalStatus }: ShowOwnerInfoProps): JSX.Element;
|
|
11
|
+
defaultProps: {
|
|
12
|
+
citizenship: string;
|
|
13
|
+
nationalAddr: string;
|
|
14
|
+
birthDate: string;
|
|
15
|
+
placeOfBirth: string;
|
|
16
|
+
maritalStatus: string;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 Box from '@mui/material/Box';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
17
|
+
import { handleNextScreenStep } from '../../../../app/settings';
|
|
18
|
+
import { styled } from '@mui/material/styles';
|
|
19
|
+
import Collapse from '../../../../components/Collapse';
|
|
20
|
+
import Button from '../../../shared/Button';
|
|
21
|
+
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
22
|
+
import { useLanguage } from '../../../../hooks';
|
|
23
|
+
import Info from './info';
|
|
24
|
+
var InputsContainerStyled = styled(Box)(function (_a) {
|
|
25
|
+
var _b;
|
|
26
|
+
var theme = _a.theme;
|
|
27
|
+
return (_b = {
|
|
28
|
+
paddingBottom: theme.spacing(5)
|
|
29
|
+
},
|
|
30
|
+
_b[theme.transitions.create(['padding-bottom'])] = {
|
|
31
|
+
duration: theme.transitions.duration.standard
|
|
32
|
+
},
|
|
33
|
+
_b);
|
|
34
|
+
});
|
|
35
|
+
var ShowOwnerInfo = function (_a) {
|
|
36
|
+
var citizenship = _a.citizenship, nationalAddr = _a.nationalAddr, birthDate = _a.birthDate, placeOfBirth = _a.placeOfBirth, maritalStatus = _a.maritalStatus;
|
|
37
|
+
var t = useTranslation().t;
|
|
38
|
+
var isAr = useLanguage().isAr;
|
|
39
|
+
var dispatch = useAppDispatch();
|
|
40
|
+
var handleClickNext = function () {
|
|
41
|
+
dispatch(handleNextScreenStep());
|
|
42
|
+
};
|
|
43
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(Collapse, __assign({ in: !!citizenship }, { children: _jsx(Info, { label: 'citizenship', value: citizenship }) })), _jsx(Collapse, __assign({ in: !!nationalAddr }, { children: _jsx(Info, { label: 'national_address', value: nationalAddr }) })), _jsx(Info, { label: t('birthdate'), value: birthDate }), _jsx(Info, { label: 'place_of_birth', value: placeOfBirth }), _jsx(Collapse, __assign({ in: !!maritalStatus }, { children: _jsx(Info, { label: 'marital_status', value: maritalStatus }) }))] }), _jsx(Button, __assign({ isAr: isAr, disabled: false, loading: false, onClick: handleClickNext }, { children: t('next') }))] }));
|
|
44
|
+
};
|
|
45
|
+
export default React.memo(ShowOwnerInfo);
|
|
46
|
+
ShowOwnerInfo.defaultProps = {
|
|
47
|
+
citizenship: '',
|
|
48
|
+
nationalAddr: 'Kuwait',
|
|
49
|
+
birthDate: '18-12-1983',
|
|
50
|
+
placeOfBirth: 'Kuwait',
|
|
51
|
+
maritalStatus: ''
|
|
52
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
15
|
+
import Text from '../../../../components/Text';
|
|
16
|
+
var LabelTextStyled = styled(Text)(function (_a) {
|
|
17
|
+
var theme = _a.theme;
|
|
18
|
+
return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), paddingInlineStart: theme.spacing(2.5), marginBlockStart: theme.spacing(3.5), marginBlockEnd: theme.spacing(1.25) }));
|
|
19
|
+
});
|
|
20
|
+
var ValueTextStyled = styled(Text)(function (_a) {
|
|
21
|
+
var theme = _a.theme;
|
|
22
|
+
return (__assign(__assign({ background: theme.palette.common.white, color: theme.palette.text.primary, border: "".concat(theme.spacing(0.125), " solid ").concat(theme.palette.divider), maxHeight: theme.spacing(5.5), paddingBlock: theme.spacing(1.75), paddingInlineStart: theme.spacing(2.5), fontWeight: theme.typography.fontWeightLight }, theme.typography.body2), { lineHeight: theme.spacing(2.125) }));
|
|
23
|
+
});
|
|
24
|
+
export default function Info(_a) {
|
|
25
|
+
var label = _a.label, value = _a.value;
|
|
26
|
+
var t = useTranslation().t;
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsx(LabelTextStyled, { children: t(label) }), _jsx(ValueTextStyled, { children: value })] }));
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var Success = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
var onSuccess = function () {
|
|
8
|
+
console.log('success');
|
|
9
|
+
alert('Account created successfully, please check your email');
|
|
10
|
+
alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
|
|
11
|
+
};
|
|
12
|
+
return _jsx(SuccessScreen, { title: t('ide_successfully_updated_message'), onSuccess: onSuccess });
|
|
13
|
+
};
|
|
14
|
+
export default React.memo(Success);
|
|
@@ -36,7 +36,7 @@ var InputsContainerStyled = styled(Box)(function (_a) {
|
|
|
36
36
|
var theme = _a.theme, listActive = _a.listActive;
|
|
37
37
|
return (_b = {
|
|
38
38
|
paddingBottom: theme.spacing(listActive ? 0 : 5),
|
|
39
|
-
overflow: '
|
|
39
|
+
overflow: 'hidden',
|
|
40
40
|
maxHeight: 'calc(100vh - 250px)'
|
|
41
41
|
},
|
|
42
42
|
_b[theme.transitions.create(['padding-bottom'])] = {
|
|
@@ -73,7 +73,7 @@ var EmployerLocation = React.forwardRef(function (_a, ref) {
|
|
|
73
73
|
employerLocationControl.field.onChange(country);
|
|
74
74
|
};
|
|
75
75
|
var location = employerLocationControl.field.value;
|
|
76
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('
|
|
76
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_employer_address_city'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_employee_location'), value: (isAr ? (_b = location === null || location === void 0 ? void 0 : location.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.english) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
77
77
|
return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIconStyled, {})] }));
|
|
78
78
|
} }) }))] })) })));
|
|
79
79
|
});
|
|
@@ -18,8 +18,9 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
18
18
|
import Input from '../../../shared/Input';
|
|
19
19
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
20
20
|
import Collapse from '../../../../components/Collapse';
|
|
21
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
21
22
|
var EmployerName = function (_a) {
|
|
22
|
-
var _b;
|
|
23
|
+
var _b, _c;
|
|
23
24
|
var show = _a.show;
|
|
24
25
|
var t = useTranslation().t;
|
|
25
26
|
var control = useFormContext().control;
|
|
@@ -30,6 +31,10 @@ var EmployerName = function (_a) {
|
|
|
30
31
|
employerNameControl.field.onChange(value);
|
|
31
32
|
};
|
|
32
33
|
var employerNameValue = employerNameControl.field.value;
|
|
33
|
-
|
|
34
|
+
var error = (_b = employerNameControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
35
|
+
var clearValue = function () {
|
|
36
|
+
employerNameControl.field.onChange('');
|
|
37
|
+
};
|
|
38
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { pt: 2.5 } }, { children: _jsx(Input, { required: true, label: t('tap_js_employer_name'), onChange: handleEmployerNameChange, value: employerNameValue, endAdornment: !error && employerNameValue ? _jsx(CheckIcon, {}) : employerNameValue && _jsx(ClearIcon, { onClick: clearValue }), placeholder: t('tap_js_enter_employer_name'), warningType: 'alert', warningMessage: (_c = employerNameControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message }) })) })));
|
|
34
39
|
};
|
|
35
40
|
export default React.memo(EmployerName);
|
|
@@ -40,6 +40,6 @@ var InfluencerSwitch = function (_a) {
|
|
|
40
40
|
influencerControl.field.onChange(target.value === 'yes');
|
|
41
41
|
};
|
|
42
42
|
var influencerValue = influencerControl.field.value;
|
|
43
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
44
44
|
};
|
|
45
45
|
export default React.memo(InfluencerSwitch);
|
|
@@ -30,6 +30,6 @@ var MonthlyIncome = function (_a) {
|
|
|
30
30
|
monthlyIncomeControl.field.onChange(value);
|
|
31
31
|
};
|
|
32
32
|
var monthlyIncomeValue = monthlyIncomeControl.field.value;
|
|
33
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('
|
|
33
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('please_enter_actual_income'), onChange: handleMonthlyIncomeChange, value: monthlyIncomeValue, endAdornment: monthlyIncomeValue && _jsx(CheckIcon, {}), placeholder: '0', warningType: 'alert', warningMessage: (_b = monthlyIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
|
|
34
34
|
};
|
|
35
35
|
export default React.memo(MonthlyIncome);
|
|
@@ -40,6 +40,6 @@ var PEPSwitch = function (_a) {
|
|
|
40
40
|
pepControl.field.onChange(target.value === 'yes');
|
|
41
41
|
};
|
|
42
42
|
var pepValue = pepControl.field.value;
|
|
43
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
|
|
44
44
|
};
|
|
45
45
|
export default React.memo(PEPSwitch);
|
|
@@ -78,7 +78,7 @@ var SourceOfIncome = function (_a) {
|
|
|
78
78
|
sourceIncomeControl.field.onChange(country);
|
|
79
79
|
};
|
|
80
80
|
var source = sourceIncomeControl.field.value;
|
|
81
|
-
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('
|
|
81
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('tap_js_source_of_income'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name : source === null || source === void 0 ? void 0 : source.nameEn) || '' }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'nameEn', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
82
82
|
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name : item === null || item === void 0 ? void 0 : item.nameEn })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
|
|
83
83
|
} }) }))] })) })));
|
|
84
84
|
};
|
|
@@ -5,7 +5,10 @@ export var OwnerInfoValidationSchema = yup.object().shape({
|
|
|
5
5
|
employerName: yup.string().when('sourceIncome', function (sourceIncomeValue) {
|
|
6
6
|
var _a;
|
|
7
7
|
if (((_a = sourceIncomeValue === null || sourceIncomeValue === void 0 ? void 0 : sourceIncomeValue.nameEn) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'salary') {
|
|
8
|
-
return yup
|
|
8
|
+
return yup
|
|
9
|
+
.string()
|
|
10
|
+
.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, 'Employer name is required')
|
|
11
|
+
.required('Employer name is required');
|
|
9
12
|
}
|
|
10
13
|
else {
|
|
11
14
|
return yup.string().optional();
|
|
@@ -27,6 +30,6 @@ export var OwnerInfoValidationSchema = yup.object().shape({
|
|
|
27
30
|
return yup.string().optional();
|
|
28
31
|
}
|
|
29
32
|
}),
|
|
30
|
-
isPEP: yup.boolean().required(),
|
|
31
|
-
isInfluencer: yup.boolean().required()
|
|
33
|
+
isPEP: yup.boolean().required('please_choose_relative_pep'),
|
|
34
|
+
isInfluencer: yup.boolean().required('please_choose_are_you_influncer')
|
|
32
35
|
});
|
|
@@ -40,7 +40,7 @@ var ShowOwnerInfo = function (_a) {
|
|
|
40
40
|
var handleClickNext = function () {
|
|
41
41
|
dispatch(handleNextScreenStep());
|
|
42
42
|
};
|
|
43
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(Collapse, __assign({ in: !!citizenship }, { children: _jsx(Info, { label: 'citizenship', value: citizenship }) })), _jsx(Collapse, __assign({ in: !!nationalAddr }, { children: _jsx(Info, { label: 'national_address', value: nationalAddr }) })), _jsx(Info, { label: '
|
|
43
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(InputsContainerStyled, { children: [_jsx(Collapse, __assign({ in: !!citizenship }, { children: _jsx(Info, { label: 'citizenship', value: citizenship }) })), _jsx(Collapse, __assign({ in: !!nationalAddr }, { children: _jsx(Info, { label: 'national_address', value: nationalAddr }) })), _jsx(Info, { label: t('birthdate'), value: birthDate }), _jsx(Info, { label: 'place_of_birth', value: placeOfBirth }), _jsx(Collapse, __assign({ in: !!maritalStatus }, { children: _jsx(Info, { label: 'marital_status', value: maritalStatus }) }))] }), _jsx(Button, __assign({ isAr: isAr, disabled: false, loading: false, onClick: handleClickNext }, { children: t('next') }))] }));
|
|
44
44
|
};
|
|
45
45
|
export default React.memo(ShowOwnerInfo);
|
|
46
46
|
ShowOwnerInfo.defaultProps = {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var Success = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
var onSuccess = function () {
|
|
8
|
+
console.log('success');
|
|
9
|
+
alert('Account created successfully, please check your email');
|
|
10
|
+
alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
|
|
11
|
+
};
|
|
12
|
+
return _jsx(SuccessScreen, { title: t('ide_successfully_updated_message'), onSuccess: onSuccess });
|
|
13
|
+
};
|
|
14
|
+
export default React.memo(Success);
|
|
@@ -20,7 +20,7 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
|
20
20
|
import Collapse from '../../components/Collapse';
|
|
21
21
|
import { reactElement } from '../../utils';
|
|
22
22
|
import { PASSWORD_SCREENS_NAVIGATION } from '../../constants';
|
|
23
|
-
import {
|
|
23
|
+
import { passwordFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { FeatureContainer } from '../shared/Containers';
|
|
26
26
|
var Password = memo(function (props) {
|
|
@@ -33,7 +33,7 @@ var Password = memo(function (props) {
|
|
|
33
33
|
useEffect(function () {
|
|
34
34
|
dispatch(handleActiveFlowScreens(PASSWORD_SCREENS_NAVIGATION));
|
|
35
35
|
}, []);
|
|
36
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children:
|
|
36
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
37
37
|
var Element = _a.element, name = _a.name;
|
|
38
38
|
var isActive = activeScreen.name === name;
|
|
39
39
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ConfirmPasswordProps {
|
|
3
|
+
showPassword: boolean;
|
|
4
|
+
onShowPassword: () => void;
|
|
5
|
+
onHidePassword: () => void;
|
|
3
6
|
}
|
|
4
|
-
declare const _default: React.MemoExoticComponent<({}: ConfirmPasswordProps) => JSX.Element>;
|
|
7
|
+
declare const _default: React.MemoExoticComponent<({ showPassword, onShowPassword, onHidePassword }: ConfirmPasswordProps) => JSX.Element>;
|
|
5
8
|
export default _default;
|
|
@@ -7,21 +7,16 @@ import PasswordIcon from '../../../shared/PasswordIcon';
|
|
|
7
7
|
import Input from '../../../shared/Input';
|
|
8
8
|
var ConfirmPassword = function (_a) {
|
|
9
9
|
var _b;
|
|
10
|
+
var showPassword = _a.showPassword, onShowPassword = _a.onShowPassword, onHidePassword = _a.onHidePassword;
|
|
10
11
|
var t = useTranslation().t;
|
|
11
12
|
var control = useFormContext().control;
|
|
12
|
-
var _c = React.useState(false), showPassword = _c[0], setShowPassword = _c[1];
|
|
13
13
|
var passwordControl = useController({ control: control, name: 'confirmPassword' });
|
|
14
14
|
var handlePasswordChange = function (_a) {
|
|
15
15
|
var target = _a.target;
|
|
16
16
|
passwordControl.field.onChange(target.value);
|
|
17
17
|
};
|
|
18
|
-
var handleShowPassword = function () {
|
|
19
|
-
setShowPassword(true);
|
|
20
|
-
};
|
|
21
|
-
var handleHidePassword = function () {
|
|
22
|
-
setShowPassword(false);
|
|
23
|
-
};
|
|
24
18
|
var passwordValue = passwordControl.field.value;
|
|
25
|
-
|
|
19
|
+
var error = (_b = passwordControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
20
|
+
return (_jsx(ScreenContainer, { children: _jsx(Input, { onChange: handlePasswordChange, value: passwordValue, autoComplete: 'confirm-password', endAdornment: _jsx(PasswordIcon, { show: showPassword, onShow: onShowPassword, onHide: onHidePassword }), placeholder: t('tap_js_confirm_password_description'), warningType: 'alert', type: showPassword ? 'text' : 'password', warningMessage: error && t(error) }) }));
|
|
26
21
|
};
|
|
27
22
|
export default React.memo(ConfirmPassword);
|
|
@@ -70,6 +70,7 @@ var Password = function (_a) {
|
|
|
70
70
|
isPasswordHasLowerLetter(passwordValue),
|
|
71
71
|
isPasswordHasSpecialLetter(passwordValue)
|
|
72
72
|
];
|
|
73
|
-
|
|
73
|
+
var error = (_b = passwordControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
74
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(Input, { label: t('tap_js_password_description'), onChange: handlePasswordChange, value: passwordValue, autoComplete: 'new-password', endAdornment: _jsx(PasswordIcon, { show: showPassword, onShow: handleShowPassword, onHide: handleHidePassword }), placeholder: t('tap_js_password_placeholder'), warningType: 'alert', type: showPassword ? 'text' : 'password', warningMessage: error && t(error) }), _jsxs(BarBoxStyled, { children: [_jsx(PasswordBar, { active: passwordConditions.filter(Boolean).length >= 1 }), _jsx(PasswordBar, { active: passwordConditions.filter(Boolean).length >= 2 }), _jsx(PasswordBar, { active: passwordConditions.filter(Boolean).length >= 3 }), _jsx(PasswordBar, { active: passwordConditions.filter(Boolean).length >= 4, sx: { marginInlineEnd: 0 } })] }), _jsx(Collapse, __assign({ in: !(passwordConditions.filter(Boolean).length >= 4), timeout: { enter: 1000, exit: 800 } }, { children: _jsxs(ListStyled, { children: [_jsx(ConditionText, { active: isPasswordMatchLength, text: '- ' + t('password_length') }), _jsx(ConditionText, { active: isPasswordHasUpper, text: '- ' + t('password_upper') }), _jsx(ConditionText, { active: isPasswordHasLower, text: '- ' + t('password_lower') }), _jsx(ConditionText, { active: isPasswordHasSpecial, text: '- ' + t('password_special') })] }) })), _jsxs(Collapse, __assign({ in: passwordConditions.filter(Boolean).length === 4, timeout: { enter: 800, exit: 1000 } }, { children: [_jsx(TextStyled, { children: t('notify_strong_password') }), _jsx(ConfirmPassword, { showPassword: showPassword, onShowPassword: handleShowPassword, onHidePassword: handleHidePassword })] }))] }));
|
|
74
75
|
};
|
|
75
76
|
export default React.memo(Password);
|