@tap-payments/auth-jsconnect 1.0.57 → 1.0.61
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/form.d.ts +2 -2
- package/build/api/entity.d.ts +20 -0
- package/build/api/entity.js +5 -1
- package/build/api/index.d.ts +3 -2
- package/build/assets/locales/ar.json +13 -1
- package/build/assets/locales/en.json +13 -1
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +3 -1
- package/build/constants/app.js +18 -18
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +8 -1
- package/build/features/Landing/Landing.js +5 -8
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +6 -20
- package/build/features/app/bank/bankStore.d.ts +5 -3
- package/build/features/app/bank/bankStore.js +81 -16
- package/build/features/app/business/businessStore.js +15 -17
- package/build/features/app/connect/connectStore.js +27 -19
- package/build/features/app/individual/individualStore.d.ts +4 -0
- package/build/features/app/individual/individualStore.js +80 -18
- package/build/features/bank/screens/BankDetails/BankDetails.js +7 -9
- package/build/features/bank/screens/BankDetails/Beneficiary.js +9 -1
- package/build/features/bank/screens/Success/Success.js +6 -0
- package/build/features/business/screens/BusinessType/LicenseNumber.js +1 -1
- package/build/features/business/screens/Success/Success.js +3 -2
- package/build/features/business/screens/{Confirm/Confirm.d.ts → SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts} +1 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +79 -0
- package/build/features/business/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/connect/screens/ThankYou/ThankYou.js +1 -4
- package/build/features/featuresScreens.js +3 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +10 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -2
- package/build/features/individual/screens/Success/Success.js +6 -0
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +13 -0
- package/build/features/shared/Button/EmailProvidersButtons.js +92 -0
- package/build/features/shared/Button/FlowsButtons.d.ts +12 -0
- package/build/features/shared/Button/FlowsButtons.js +57 -0
- package/build/features/shared/Button/index.d.ts +3 -1
- package/build/features/shared/Button/index.js +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +4 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +4 -4
- package/package.json +1 -1
- package/build/features/business/screens/BusinessType/CRNumber.d.ts +0 -7
- package/build/features/business/screens/BusinessType/CRNumber.js +0 -41
- package/build/features/business/screens/BusinessType/CompanyLicense.d.ts +0 -11
- package/build/features/business/screens/BusinessType/CompanyLicense.js +0 -127
- package/build/features/business/screens/BusinessType/FLNumber.d.ts +0 -7
- package/build/features/business/screens/BusinessType/FLNumber.js +0 -41
- package/build/features/business/screens/BusinessType/FreelanceLicense.d.ts +0 -11
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +0 -127
- package/build/features/business/screens/Confirm/Confirm.js +0 -56
- package/build/features/business/screens/Confirm/index.d.ts +0 -3
- package/build/features/business/screens/Confirm/index.js +0 -2
- package/build/features/connect/screens/Mobile/BusinessCountry.d.ts +0 -8
- package/build/features/connect/screens/Mobile/BusinessCountry.js +0 -40
- package/build/features/connect/screens/Password/Password.d.ts +0 -5
- package/build/features/connect/screens/Password/Password.js +0 -60
- package/build/features/connect/screens/Password/PasswordInput.d.ts +0 -5
- package/build/features/connect/screens/Password/PasswordInput.js +0 -39
- package/build/features/connect/screens/Password/index.d.ts +0 -3
- package/build/features/connect/screens/Password/index.js +0 -2
- package/build/features/connect/screens/Password/validation.d.ts +0 -8
- package/build/features/connect/screens/Password/validation.js +0 -4
|
@@ -1,127 +0,0 @@
|
|
|
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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
-
if (ar || !(i in from)) {
|
|
26
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
-
ar[i] = from[i];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
-
};
|
|
32
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
import * as React from 'react';
|
|
34
|
-
import { useTranslation } from 'react-i18next';
|
|
35
|
-
import { useFormContext } from 'react-hook-form';
|
|
36
|
-
import Box from '@mui/material/Box';
|
|
37
|
-
import { styled } from '@mui/material/styles';
|
|
38
|
-
import Text from '../../../../components/Text';
|
|
39
|
-
import Collapse from '../../../../components/Collapse';
|
|
40
|
-
import { useLanguage } from '../../../../hooks';
|
|
41
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
42
|
-
import CheckIcon from '../../../shared/CheckIcon';
|
|
43
|
-
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
44
|
-
import Input from '../../../shared/Input';
|
|
45
|
-
import { OTHER_LICENSE } from '../../../../constants';
|
|
46
|
-
import SimpleList from '../../../../components/SimpleList';
|
|
47
|
-
import FLNumber from './FLNumber';
|
|
48
|
-
var InputStyled = styled(Input)(function (_a) {
|
|
49
|
-
var theme = _a.theme;
|
|
50
|
-
return ({
|
|
51
|
-
marginBottom: theme.spacing(2.5),
|
|
52
|
-
'& .MuiInputBase-input': {
|
|
53
|
-
cursor: 'pointer'
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
var LicenseContainer = styled(Box)(function () { return ({
|
|
58
|
-
display: 'flex'
|
|
59
|
-
}); });
|
|
60
|
-
var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
61
|
-
var theme = _a.theme, isSelected = _a.isSelected;
|
|
62
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
63
|
-
});
|
|
64
|
-
var FreelanceLicense = function (_a) {
|
|
65
|
-
var show = _a.show, list = _a.list, rest = __rest(_a, ["show", "list"]);
|
|
66
|
-
var _b = React.useState(list), licenseList = _b[0], setLicenseList = _b[1];
|
|
67
|
-
var _c = React.useState(), selectedLicense = _c[0], setSelectedLicense = _c[1];
|
|
68
|
-
var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
|
|
69
|
-
var t = useTranslation().t;
|
|
70
|
-
var isAr = useLanguage().isAr;
|
|
71
|
-
var setValue = useFormContext().setValue;
|
|
72
|
-
var onOpenLicenseList = function (event) {
|
|
73
|
-
var _a;
|
|
74
|
-
setAnchorEl(event.currentTarget);
|
|
75
|
-
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
76
|
-
};
|
|
77
|
-
var onCloseLicenseList = function () {
|
|
78
|
-
var _a;
|
|
79
|
-
setAnchorEl(null);
|
|
80
|
-
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
81
|
-
};
|
|
82
|
-
React.useEffect(function () {
|
|
83
|
-
var array = list;
|
|
84
|
-
if ((array === null || array === void 0 ? void 0 : array.length) > 0) {
|
|
85
|
-
var hasOther = array === null || array === void 0 ? void 0 : array.find(function (item) { return isOtherLicense(item); });
|
|
86
|
-
var first = array[0];
|
|
87
|
-
if (!!first) {
|
|
88
|
-
setSelectedLicense(first);
|
|
89
|
-
setValue('flNumber', getLicenseNumber(first), { shouldValidate: true });
|
|
90
|
-
if (!hasOther)
|
|
91
|
-
array = __spreadArray(__spreadArray([], array, true), [OTHER_LICENSE], false);
|
|
92
|
-
setLicenseList(array);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, [show, list]);
|
|
96
|
-
var getLicenseNumber = function (item) {
|
|
97
|
-
var _a;
|
|
98
|
-
return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) || '';
|
|
99
|
-
};
|
|
100
|
-
var isOtherLicense = function (item) {
|
|
101
|
-
var _a;
|
|
102
|
-
return ((_a = item === null || item === void 0 ? void 0 : item.license) === null || _a === void 0 ? void 0 : _a.number) === 'other';
|
|
103
|
-
};
|
|
104
|
-
var getLicenseName = function (item) {
|
|
105
|
-
var _a, _b;
|
|
106
|
-
return (isAr ? (_a = item === null || item === void 0 ? void 0 : item.legal_name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.legal_name) === null || _b === void 0 ? void 0 : _b.en) || '';
|
|
107
|
-
};
|
|
108
|
-
var onSelectItem = function (license) {
|
|
109
|
-
setSelectedLicense(license);
|
|
110
|
-
onCloseLicenseList();
|
|
111
|
-
if (isOtherLicense(license))
|
|
112
|
-
setValue('flNumber', '');
|
|
113
|
-
else
|
|
114
|
-
setValue('flNumber', getLicenseNumber(license), { shouldValidate: true });
|
|
115
|
-
};
|
|
116
|
-
var hasList = (licenseList === null || licenseList === void 0 ? void 0 : licenseList.length) > 0;
|
|
117
|
-
var showFLNumber = !anchorEl;
|
|
118
|
-
var flReadonly = !isOtherLicense(selectedLicense);
|
|
119
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('enter_freelance_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_fl'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
120
|
-
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selectedLicense) }, { children: isOtherLicense(item)
|
|
121
|
-
? t(getLicenseNumber(item))
|
|
122
|
-
: isAr
|
|
123
|
-
? getLicenseName(item)
|
|
124
|
-
: getLicenseNumber(item) + '-' + getLicenseName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selectedLicense) && _jsx(CheckIcon, {})] }));
|
|
125
|
-
} }) }))] })), _jsx(FLNumber, { show: showFLNumber, readOnly: flReadonly })] }) })));
|
|
126
|
-
};
|
|
127
|
-
export default React.memo(FreelanceLicense);
|
|
@@ -1,56 +0,0 @@
|
|
|
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 { useSelector } from 'react-redux';
|
|
15
|
-
import { styled } from '@mui/material/styles';
|
|
16
|
-
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
19
|
-
import { FormProvider, useForm } from 'react-hook-form';
|
|
20
|
-
import Form from '../../../../components/Form';
|
|
21
|
-
import Input from '../../../shared/Input';
|
|
22
|
-
import Button from '../../../shared/Button';
|
|
23
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
24
|
-
import { businessSelector, createAccount } from '../../../app/business/businessStore';
|
|
25
|
-
import { BusinessType as BusinessTypeEnum } from '../../../../@types';
|
|
26
|
-
var InputStyled = styled(Input)(function (_a) {
|
|
27
|
-
var theme = _a.theme;
|
|
28
|
-
return ({
|
|
29
|
-
marginBlockEnd: theme.spacing(3)
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
var FormStyled = styled(Form)(function () { return ({
|
|
33
|
-
display: 'flex',
|
|
34
|
-
flexDirection: 'column'
|
|
35
|
-
}); });
|
|
36
|
-
var Confirm = function () {
|
|
37
|
-
var dispatch = useAppDispatch();
|
|
38
|
-
var t = useTranslation().t;
|
|
39
|
-
var isAr = useLanguage().isAr;
|
|
40
|
-
var _a = useSelector(businessSelector), data = _a.data, loading = _a.loading, error = _a.error;
|
|
41
|
-
var _b = data.businessInfo, licenseNumber = _b.licenseNumber, brandName = _b.brandName, legalName = _b.legalName;
|
|
42
|
-
var isCR = data.businessTypeData.businessType === BusinessTypeEnum.CR;
|
|
43
|
-
var onSubmit = function () {
|
|
44
|
-
dispatch(createAccount());
|
|
45
|
-
};
|
|
46
|
-
var methods = useForm({
|
|
47
|
-
defaultValues: data.businessInfo,
|
|
48
|
-
mode: 'onChange'
|
|
49
|
-
});
|
|
50
|
-
var onBack = function () {
|
|
51
|
-
dispatch(handlePrevScreenStep());
|
|
52
|
-
};
|
|
53
|
-
var disabled = !methods.formState.isValid || !!error;
|
|
54
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? 'signup_business_cr_info_title' : 'signup_business_fl_info_title'), value: licenseNumber, disabled: true }), _jsx(InputStyled, { label: t('signup_brand_name_label'), placeholder: t('signup_brand_name_label'), value: brandName, disabled: true }), _jsx(InputStyled, { sx: { marginBlockEnd: 0 }, label: t('signup_legal_name_label'), placeholder: t('signup_legal_name_label'), value: legalName, disabled: true }), _jsx(Button, __assign({ disabled: disabled, loading: loading, error: t(error || ''), onBackClicked: function () { return onBack(); }, isAr: isAr }, { children: t('confirm') }))] })) })) }));
|
|
55
|
-
};
|
|
56
|
-
export default React.memo(Confirm);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CountryCode } from '../../../../@types';
|
|
3
|
-
interface BusinessCountryProps {
|
|
4
|
-
country: CountryCode;
|
|
5
|
-
show: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BusinessCountryProps & React.RefAttributes<unknown>>>;
|
|
8
|
-
export default _default;
|
|
@@ -1,40 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { styled } from '@mui/material/styles';
|
|
15
|
-
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import Text from '../../../../components/Text';
|
|
17
|
-
import Collapse from '../../../../components/Collapse';
|
|
18
|
-
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
19
|
-
import Icon from '../../../../components/Icon';
|
|
20
|
-
import Input from '../../../shared/Input';
|
|
21
|
-
import { useLanguage } from '../../../../hooks';
|
|
22
|
-
var CountrySpanStyled = styled(Text)(function () { return ({
|
|
23
|
-
cursor: 'pointer'
|
|
24
|
-
}); });
|
|
25
|
-
var CountryIconStyled = styled(Icon)(function (_a) {
|
|
26
|
-
var theme = _a.theme;
|
|
27
|
-
return ({
|
|
28
|
-
width: theme.spacing(2.75),
|
|
29
|
-
height: theme.spacing(2),
|
|
30
|
-
verticalAlign: 'middle'
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
var BusinessCountry = React.forwardRef(function (_a, ref) {
|
|
34
|
-
var _b, _c;
|
|
35
|
-
var country = _a.country, show = _a.show;
|
|
36
|
-
var t = useTranslation().t;
|
|
37
|
-
var isAr = useLanguage().isAr;
|
|
38
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ ref: ref, sx: { marginBottom: '25px' } }, { children: _jsx(Input, { sx: { cursor: 'auto' }, label: t('signup_select_country'), readOnly: true, disabled: true, startAdornment: _jsx(CountrySpanStyled, { children: _jsx(CountryIconStyled, { src: (country === null || country === void 0 ? void 0 : country.logo) || '' }) }), placeholder: t('ide_mobile_placeholder'), value: (isAr ? (_b = country === null || country === void 0 ? void 0 : country.name) === null || _b === void 0 ? void 0 : _b.arabic : (_c = country === null || country === void 0 ? void 0 : country.name) === null || _c === void 0 ? void 0 : _c.english) || '' }) })) })));
|
|
39
|
-
});
|
|
40
|
-
export default React.memo(BusinessCountry);
|
|
@@ -1,60 +0,0 @@
|
|
|
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 { useSelector } from 'react-redux';
|
|
15
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
16
|
-
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
|
-
import { styled } from '@mui/material/styles';
|
|
20
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
|
-
import { clearError, connectSelector } from '../../../app/connect/connectStore';
|
|
22
|
-
import Form from '../../../../components/Form';
|
|
23
|
-
import Button from '../../../shared/Button';
|
|
24
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import { useLanguage } from '../../../../hooks';
|
|
26
|
-
import { PasswordValidationSchema } from './validation';
|
|
27
|
-
import PasswordInput from './PasswordInput';
|
|
28
|
-
var FormStyled = styled(Form)(function () { return ({
|
|
29
|
-
display: 'flex',
|
|
30
|
-
flexDirection: 'column',
|
|
31
|
-
justifyContent: 'space-between',
|
|
32
|
-
height: '100%'
|
|
33
|
-
}); });
|
|
34
|
-
var Password = function (_a) {
|
|
35
|
-
var dispatch = useAppDispatch();
|
|
36
|
-
var _b = useSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
37
|
-
var methods = useForm({
|
|
38
|
-
resolver: yupResolver(PasswordValidationSchema),
|
|
39
|
-
defaultValues: {
|
|
40
|
-
password: ''
|
|
41
|
-
},
|
|
42
|
-
mode: 'onChange'
|
|
43
|
-
});
|
|
44
|
-
var t = useTranslation().t;
|
|
45
|
-
var isAr = useLanguage().isAr;
|
|
46
|
-
var isAbsher = data.otpData.isAbsher;
|
|
47
|
-
React.useEffect(function () {
|
|
48
|
-
if (error)
|
|
49
|
-
dispatch(clearError());
|
|
50
|
-
}, [methods.formState.isValid]);
|
|
51
|
-
var onSubmit = function (formData) {
|
|
52
|
-
console.log(formData);
|
|
53
|
-
};
|
|
54
|
-
var onBack = function () {
|
|
55
|
-
dispatch(handlePrevScreenStep(isAbsher ? 'CONNECT_NID_STEP' : 'CONNECT_MOBILE_STEP'));
|
|
56
|
-
};
|
|
57
|
-
var disabled = !methods.formState.isValid || !!error;
|
|
58
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(PasswordInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
59
|
-
};
|
|
60
|
-
export default React.memo(Password);
|
|
@@ -1,39 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
-
import * as React from 'react';
|
|
14
|
-
import { useTranslation } from 'react-i18next';
|
|
15
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import PasswordIcon from '../../../shared/PasswordIcon';
|
|
17
|
-
import { ScreenContainer } from '../../../shared/Containers';
|
|
18
|
-
import Input from '../../../shared/Input';
|
|
19
|
-
var PasswordInput = function (_a) {
|
|
20
|
-
var _b;
|
|
21
|
-
var t = useTranslation().t;
|
|
22
|
-
var control = useFormContext().control;
|
|
23
|
-
var _c = React.useState(false), showPassword = _c[0], setShowPassword = _c[1];
|
|
24
|
-
var passwordControl = useController({ control: control, name: 'password' });
|
|
25
|
-
var handlePasswordChange = function (_a) {
|
|
26
|
-
var target = _a.target;
|
|
27
|
-
passwordControl.field.onChange(target.value);
|
|
28
|
-
};
|
|
29
|
-
var handleShowPassword = function () {
|
|
30
|
-
setShowPassword(true);
|
|
31
|
-
};
|
|
32
|
-
var handleHidePassword = function () {
|
|
33
|
-
setShowPassword(false);
|
|
34
|
-
};
|
|
35
|
-
var passwordValue = passwordControl.field.value;
|
|
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: 8 }) }) })));
|
|
38
|
-
};
|
|
39
|
-
export default React.memo(PasswordInput);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
export declare const PasswordValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
-
password: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
-
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
5
|
-
password: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
-
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
-
password: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
|
-
}>>>;
|