@tap-payments/auth-jsconnect 1.0.68 → 1.0.71
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 +3 -3
- package/build/api/data.d.ts +1 -0
- package/build/api/data.js +5 -1
- package/build/api/index.d.ts +1 -0
- package/build/assets/locales/ar.json +2 -1
- package/build/assets/locales/en.json +2 -1
- package/build/components/SimpleList/SimpleList.js +3 -0
- package/build/constants/api.d.ts +1 -0
- package/build/constants/api.js +2 -0
- package/build/constants/assets.d.ts +7 -0
- package/build/constants/assets.js +13 -6
- package/build/constants/dummy.d.ts +1 -1
- package/build/constants/dummy.js +6 -6
- package/build/features/app/business/businessStore.js +4 -2
- package/build/features/app/connect/connectStore.js +4 -2
- package/build/features/app/individual/individualStore.d.ts +8 -1
- package/build/features/app/individual/individualStore.js +85 -15
- package/build/features/bank/screens/BankDetails/BankName.js +18 -5
- package/build/features/bank/screens/BankDetails/IBAN.js +1 -8
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -3
- package/build/features/bank/screens/BankDetails/validation.js +1 -1
- package/build/features/bank/screens/Verify/Verify.js +3 -4
- package/build/features/business/screens/Activities/Activities.js +2 -3
- package/build/features/business/screens/Activities/ActivitiesList.js +2 -3
- package/build/features/business/screens/Activities/SalesChannels.js +2 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +2 -3
- package/build/features/business/screens/BusinessType/LicenseList.js +2 -3
- package/build/features/business/screens/Customers/CustomerLocations.js +2 -3
- package/build/features/business/screens/Customers/Customers.js +2 -3
- package/build/features/business/screens/Customers/ExpectedCustomers.js +2 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +2 -3
- package/build/features/business/screens/IDBOD/DOB.js +6 -0
- package/build/features/business/screens/IDBOD/IDBOD.js +3 -8
- package/build/features/business/screens/OTP/OTP.js +3 -4
- package/build/features/business/screens/OTP/OTPInput.js +2 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/business/screens/Verify/Verify.js +3 -4
- package/build/features/connect/screens/Individual/Individual.js +2 -3
- package/build/features/connect/screens/Individual/MobileNumber.js +22 -8
- package/build/features/connect/screens/Merchant/BrandName.js +2 -3
- package/build/features/connect/screens/Merchant/Merchant.js +2 -3
- package/build/features/connect/screens/Mobile/Mobile.js +3 -4
- package/build/features/connect/screens/Mobile/MobileNumber.js +25 -9
- package/build/features/connect/screens/NID/DOB.js +2 -3
- package/build/features/connect/screens/NID/NID.js +3 -4
- package/build/features/connect/screens/OTP/OTP.js +2 -3
- package/build/features/connect/screens/OTP/OTPInput.js +2 -3
- package/build/features/individual/Individual.js +6 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -11
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +5 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +1 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +18 -12
- package/build/features/individual/screens/Verify/Verify.js +3 -4
- package/build/features/password/screens/Verify/Verify.js +3 -4
- package/build/features/shared/Button/SuccessButton.d.ts +9 -0
- package/build/features/shared/Button/SuccessButton.js +71 -0
- package/build/features/shared/Button/index.d.ts +2 -1
- package/build/features/shared/Button/index.js +2 -1
- package/build/features/shared/Footer/Footer.js +2 -3
- package/build/features/shared/Search/Search.d.ts +7 -0
- package/build/features/shared/Search/Search.js +25 -0
- package/build/features/shared/Search/index.d.ts +2 -0
- package/build/features/shared/Search/index.js +2 -0
- package/build/features/shared/SearchIcon/SearchIcon.d.ts +6 -0
- package/build/features/shared/SearchIcon/SearchIcon.js +26 -0
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -3
- package/build/features/tax/screens/Verify/Verify.js +3 -4
- package/package.json +1 -1
|
@@ -20,12 +20,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
20
20
|
};
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
import * as React from 'react';
|
|
23
|
-
import { useSelector } from 'react-redux';
|
|
24
23
|
import Box from '@mui/material/Box';
|
|
25
24
|
import { alpha, styled } from '@mui/material/styles';
|
|
26
25
|
import { useTranslation } from 'react-i18next';
|
|
27
26
|
import { useController, useFormContext } from 'react-hook-form';
|
|
28
|
-
import { useLanguage } from '../../../../hooks';
|
|
27
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
29
28
|
import Text from '../../../../components/Text';
|
|
30
29
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
31
30
|
import CheckBox from '../../../../components/CheckBox';
|
|
@@ -83,7 +82,7 @@ var SalesChannels = function () {
|
|
|
83
82
|
var channelsControl = useController({ name: 'salesChannels', control: control });
|
|
84
83
|
var channelsChecked = channelsControl.field.value;
|
|
85
84
|
var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
-
var data =
|
|
85
|
+
var data = useAppSelector(businessSelector).data;
|
|
87
86
|
var channelList = (data.businessTypeData.responseBody || {}).channelList;
|
|
88
87
|
React.useEffect(function () {
|
|
89
88
|
if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
|
|
@@ -11,11 +11,10 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
18
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
17
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
18
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
20
19
|
import Form from '../../../../components/Form';
|
|
21
20
|
import Collapse from '../../../../components/Collapse';
|
|
@@ -26,7 +25,7 @@ import Button from '../../../shared/Button';
|
|
|
26
25
|
import { LicenseValidationSchema } from './validation';
|
|
27
26
|
import LicenseList from './LicenseList';
|
|
28
27
|
var BusinessType = function (_a) {
|
|
29
|
-
var _b =
|
|
28
|
+
var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
30
29
|
var t = useTranslation().t;
|
|
31
30
|
var isAr = useLanguage().isAr;
|
|
32
31
|
var dispatch = useAppDispatch();
|
|
@@ -22,12 +22,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
import { useSelector } from 'react-redux';
|
|
26
25
|
import { useTranslation } from 'react-i18next';
|
|
27
26
|
import { useController, useFormContext } from 'react-hook-form';
|
|
28
27
|
import Box from '@mui/material/Box';
|
|
29
28
|
import { styled } from '@mui/material/styles';
|
|
30
|
-
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
29
|
+
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
31
30
|
import { BusinessType } from '../../../../@types';
|
|
32
31
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
33
32
|
import Input from '../../../shared/Input';
|
|
@@ -56,7 +55,7 @@ var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return
|
|
|
56
55
|
});
|
|
57
56
|
var LicenseList = function (_a) {
|
|
58
57
|
var rest = __rest(_a, []);
|
|
59
|
-
var _b =
|
|
58
|
+
var _b = useAppSelector(businessSelector), data = _b.data, error = _b.error;
|
|
60
59
|
var businessTypeData = data.businessTypeData;
|
|
61
60
|
var _c = React.useState(null), anchorEl = _c[0], setAnchorEl = _c[1];
|
|
62
61
|
var t = useTranslation().t;
|
|
@@ -22,7 +22,6 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
import { useSelector } from 'react-redux';
|
|
26
25
|
import Box from '@mui/material/Box';
|
|
27
26
|
import { useTranslation } from 'react-i18next';
|
|
28
27
|
import { useController, useFormContext } from 'react-hook-form';
|
|
@@ -34,7 +33,7 @@ import ExpandIcon from '../../../../components/ExpandIcon';
|
|
|
34
33
|
import Input from '../../../../components/Input';
|
|
35
34
|
import SimpleList from '../../../../components/SimpleList';
|
|
36
35
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
37
|
-
import { useLanguage } from '../../../../hooks';
|
|
36
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
38
37
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
39
38
|
export var InputLabelStyled = styled(Text)(function (_a) {
|
|
40
39
|
var theme = _a.theme;
|
|
@@ -80,7 +79,7 @@ var customerLocations = function (_a) {
|
|
|
80
79
|
var isAr = useLanguage().isAr;
|
|
81
80
|
var control = useFormContext().control;
|
|
82
81
|
var customerLocationsControl = useController({ name: 'customerLocations', control: control });
|
|
83
|
-
var data =
|
|
82
|
+
var data = useAppSelector(businessSelector).data;
|
|
84
83
|
var activitiesData = data.activitiesData;
|
|
85
84
|
var response = activitiesData.responseBody;
|
|
86
85
|
var onOpenList = function (event) {
|
|
@@ -11,13 +11,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import Box from '@mui/material/Box/Box';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { styled } from '@mui/material/styles';
|
|
16
15
|
import * as React from 'react';
|
|
17
16
|
import { useTranslation } from 'react-i18next';
|
|
18
17
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
19
18
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
19
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
20
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
22
21
|
import { CustomerInfoValidation } from './validation';
|
|
23
22
|
import Form from '../../../../components/Form';
|
|
@@ -44,7 +43,7 @@ var ListType;
|
|
|
44
43
|
var Customers = function (_a) {
|
|
45
44
|
var _b = React.useState(), listActive = _b[0], setListActive = _b[1];
|
|
46
45
|
var dispatch = useAppDispatch();
|
|
47
|
-
var _c =
|
|
46
|
+
var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
48
47
|
var customerData = data.customersData;
|
|
49
48
|
var methods = useForm({
|
|
50
49
|
resolver: yupResolver(CustomerInfoValidation),
|
|
@@ -22,12 +22,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
import * as React from 'react';
|
|
25
|
-
import { useSelector } from 'react-redux';
|
|
26
25
|
import Box from '@mui/material/Box';
|
|
27
26
|
import { styled } from '@mui/material/styles';
|
|
28
27
|
import { useTranslation } from 'react-i18next';
|
|
29
28
|
import { useController, useFormContext } from 'react-hook-form';
|
|
30
|
-
import { useLanguage } from '../../../../hooks';
|
|
29
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
31
30
|
import SimpleList from '../../../../components/SimpleList';
|
|
32
31
|
import Collapse from '../../../../components/Collapse';
|
|
33
32
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
@@ -52,7 +51,7 @@ var ExpectedCustomers = function (_a) {
|
|
|
52
51
|
var isAr = useLanguage().isAr;
|
|
53
52
|
var control = useFormContext().control;
|
|
54
53
|
var expectedCustomerControl = useController({ name: 'expectedCustomer', control: control });
|
|
55
|
-
var data =
|
|
54
|
+
var data = useAppSelector(businessSelector).data;
|
|
56
55
|
var activitiesData = data.activitiesData;
|
|
57
56
|
var response = activitiesData.responseBody;
|
|
58
57
|
var onOpenList = function (event) {
|
|
@@ -26,13 +26,12 @@ import Box from '@mui/material/Box';
|
|
|
26
26
|
import { styled } from '@mui/material/styles';
|
|
27
27
|
import { useTranslation } from 'react-i18next';
|
|
28
28
|
import { useController, useFormContext } from 'react-hook-form';
|
|
29
|
-
import { useLanguage } from '../../../../hooks';
|
|
29
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
30
30
|
import SimpleList from '../../../../components/SimpleList';
|
|
31
31
|
import Collapse from '../../../../components/Collapse';
|
|
32
32
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
33
33
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
34
|
import { InputLabelStyled, CheckIconStyled, InputStyled, NameContainer } from './CustomerLocations';
|
|
35
|
-
import { useSelector } from 'react-redux';
|
|
36
35
|
import { businessSelector } from '../../../../features/app/business/businessStore';
|
|
37
36
|
var ListItemContainer = styled(Box)(function () { return ({
|
|
38
37
|
display: 'flex'
|
|
@@ -48,7 +47,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
48
47
|
var isAr = useLanguage().isAr;
|
|
49
48
|
var control = useFormContext().control;
|
|
50
49
|
var expectedSalesRangeControl = useController({ name: 'expectedSalesRange', control: control });
|
|
51
|
-
var data =
|
|
50
|
+
var data = useAppSelector(businessSelector).data;
|
|
52
51
|
var activitiesData = data.activitiesData;
|
|
53
52
|
var response = activitiesData.responseBody;
|
|
54
53
|
var onOpenList = function (event) {
|
|
@@ -13,10 +13,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
17
|
import { styled, alpha } from '@mui/material/styles';
|
|
17
18
|
import Text from '../../../../components/Text';
|
|
18
19
|
import DatePicker from '../../../../components/DatePicker';
|
|
19
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
|
+
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
20
22
|
var InputLabelStyled = styled(Text)(function (_a) {
|
|
21
23
|
var theme = _a.theme;
|
|
22
24
|
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { cursor: 'pointer' }));
|
|
@@ -26,8 +28,12 @@ var BOD = function (_a) {
|
|
|
26
28
|
var onDateClicked = _a.onDateClicked;
|
|
27
29
|
var t = useTranslation().t;
|
|
28
30
|
var control = useFormContext().control;
|
|
31
|
+
var dispatch = useAppDispatch();
|
|
29
32
|
var dobControl = useController({ control: control, name: 'dob' });
|
|
33
|
+
var error = useAppSelector(businessSelector).error;
|
|
30
34
|
var handleBirthDateChange = function (data) {
|
|
35
|
+
if (error)
|
|
36
|
+
dispatch(clearError());
|
|
31
37
|
dobControl.field.onChange(data);
|
|
32
38
|
};
|
|
33
39
|
var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -11,13 +11,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
16
|
import { styled } from '@mui/material/styles';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
|
-
import { useAppDispatch, useLanguage } from '../../../../hooks';
|
|
20
|
-
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
18
|
+
import { useAppDispatch, useLanguage, useAppSelector } from '../../../../hooks';
|
|
21
19
|
import Form from '../../../../components/Form';
|
|
22
20
|
import Button from '../../../shared/Button';
|
|
23
21
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -35,7 +33,7 @@ var IDBOD = function (_a) {
|
|
|
35
33
|
var isAr = useLanguage().isAr;
|
|
36
34
|
var dispatch = useAppDispatch();
|
|
37
35
|
var t = useTranslation().t;
|
|
38
|
-
var _c =
|
|
36
|
+
var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
39
37
|
var methods = useForm({
|
|
40
38
|
resolver: yupResolver(NIDValidationSchema),
|
|
41
39
|
defaultValues: data.nidData,
|
|
@@ -51,10 +49,7 @@ var IDBOD = function (_a) {
|
|
|
51
49
|
var handleCollapseOpenClose = function (flag) {
|
|
52
50
|
setCollapse(flag);
|
|
53
51
|
};
|
|
54
|
-
var onBack = function () {
|
|
55
|
-
dispatch(handlePrevScreenStep());
|
|
56
|
-
};
|
|
57
52
|
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(Collapse, __assign({ in: !collapse }, { children: _jsx(ID, {}) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, isAr: isAr, disabled: disabled,
|
|
53
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ID, {}) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, disableBack: true, isAr: isAr, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
|
|
59
54
|
};
|
|
60
55
|
export default React.memo(IDBOD);
|
|
@@ -11,8 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import {
|
|
15
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
@@ -48,7 +47,7 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
48
47
|
flexDirection: 'column'
|
|
49
48
|
}); });
|
|
50
49
|
var OTP = function (_a) {
|
|
51
|
-
var _b =
|
|
50
|
+
var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
52
51
|
var dispatch = useAppDispatch();
|
|
53
52
|
var methods = useForm({
|
|
54
53
|
resolver: yupResolver(OTPValidation),
|
|
@@ -72,7 +71,7 @@ var OTP = function (_a) {
|
|
|
72
71
|
};
|
|
73
72
|
var disabled = !methods.formState.isValid || !!error;
|
|
74
73
|
var idNumber = data.nidData.nid;
|
|
75
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled,
|
|
74
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskID(idNumber || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
76
75
|
};
|
|
77
76
|
OTP.defaultProps = {};
|
|
78
77
|
export default React.memo(OTP);
|
|
@@ -11,7 +11,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import Box from '@mui/material/Box/Box';
|
|
@@ -19,7 +18,7 @@ import { styled } from '@mui/material/styles';
|
|
|
19
18
|
import OTPField from '../../../shared/OTP';
|
|
20
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
20
|
import { businessSelector, updateLeadIdentity } from '../../../app/business/businessStore';
|
|
22
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
22
|
var BoxStyled = styled(Box)(function (_a) {
|
|
24
23
|
var theme = _a.theme;
|
|
25
24
|
return ({
|
|
@@ -33,7 +32,7 @@ var OTPInput = function (_a) {
|
|
|
33
32
|
var t = useTranslation().t;
|
|
34
33
|
var dispatch = useAppDispatch();
|
|
35
34
|
var otpControl = useController({ name: 'otp', control: control });
|
|
36
|
-
var data =
|
|
35
|
+
var data = useAppSelector(businessSelector).data;
|
|
37
36
|
var nidData = data.nidData;
|
|
38
37
|
var handleOnOTPChange = function (otp) {
|
|
39
38
|
otpControl.field.onChange(otp);
|
|
@@ -63,9 +63,9 @@ var SuccessWithFlowButtons = function () {
|
|
|
63
63
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
64
64
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
65
65
|
var title = t("".concat(name, "_flow_").concat(type), { individual_name: username });
|
|
66
|
-
var src = "".concat(name, "_filled_icon");
|
|
67
|
-
var hoverSrc = "".concat(name, "_white_icon");
|
|
68
66
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
67
|
+
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
68
|
+
var hoverSrc = "".concat(name, "_white_icon");
|
|
69
69
|
return {
|
|
70
70
|
title: title,
|
|
71
71
|
href: url,
|
|
@@ -11,9 +11,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
15
15
|
import { useTranslation } from 'react-i18next';
|
|
16
|
-
import { useSelector } from 'react-redux';
|
|
17
16
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
18
|
import Box from '@mui/material/Box/Box';
|
|
@@ -50,7 +49,7 @@ var FormStyled = styled(Form)(function () { return ({
|
|
|
50
49
|
var VerifyNumber = function (_a) {
|
|
51
50
|
var _b, _c, _d;
|
|
52
51
|
var dispatch = useAppDispatch();
|
|
53
|
-
var _e =
|
|
52
|
+
var _e = useAppSelector(businessSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
54
53
|
var methods = useForm({
|
|
55
54
|
resolver: yupResolver(OTPValidation),
|
|
56
55
|
defaultValues: data.otpData,
|
|
@@ -73,6 +72,6 @@ var VerifyNumber = function (_a) {
|
|
|
73
72
|
};
|
|
74
73
|
var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
|
|
75
74
|
var disabled = !methods.formState.isValid || !!error || !phone;
|
|
76
|
-
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'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled,
|
|
75
|
+
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'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
|
|
77
76
|
};
|
|
78
77
|
export default React.memo(VerifyNumber);
|
|
@@ -10,7 +10,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useSelector } from 'react-redux';
|
|
14
13
|
import { styled } from '@mui/material/styles';
|
|
15
14
|
import Email from './Email';
|
|
16
15
|
import Name from './Name';
|
|
@@ -18,7 +17,7 @@ import * as React from 'react';
|
|
|
18
17
|
import { useTranslation } from 'react-i18next';
|
|
19
18
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
20
19
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
21
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
22
21
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
22
|
import { IndividualValidation, IndividualMobileValidation } from './validation';
|
|
24
23
|
import Form from '../../../../components/Form';
|
|
@@ -37,7 +36,7 @@ var Individual = function (_a) {
|
|
|
37
36
|
var _b, _c, _d;
|
|
38
37
|
var _e = React.useState(false), listActive = _e[0], setListActive = _e[1];
|
|
39
38
|
var _f = React.useState(false), emailChecking = _f[0], setEmailChecking = _f[1];
|
|
40
|
-
var _g =
|
|
39
|
+
var _g = useAppSelector(connectSelector), data = _g.data, loading = _g.loading, error = _g.error;
|
|
41
40
|
var dispatch = useAppDispatch();
|
|
42
41
|
var t = useTranslation().t;
|
|
43
42
|
var isAr = useLanguage().isAr;
|
|
@@ -36,6 +36,7 @@ import Input from '../../../shared/Input';
|
|
|
36
36
|
import SimpleList from '../../../../components/SimpleList';
|
|
37
37
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
38
38
|
import { useLanguage } from '../../../../hooks';
|
|
39
|
+
import Search from '../../../shared/Search';
|
|
39
40
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
40
41
|
var theme = _a.theme;
|
|
41
42
|
return ({
|
|
@@ -74,11 +75,11 @@ var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
|
|
|
74
75
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
75
76
|
var _b, _c, _d;
|
|
76
77
|
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
77
|
-
var
|
|
78
|
-
var
|
|
78
|
+
var _e = React.useState(countries || []), countriesCode = _e[0], setCountries = _e[1];
|
|
79
|
+
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
79
80
|
var t = useTranslation().t;
|
|
80
81
|
var isAr = useLanguage().isAr;
|
|
81
|
-
var
|
|
82
|
+
var _g = useFormContext(), control = _g.control, setValue = _g.setValue;
|
|
82
83
|
var phoneControl = useController({ name: 'mobile', control: control });
|
|
83
84
|
var countryCodeControl = useController({ name: 'countryCode', control: control });
|
|
84
85
|
var countryCodeValue = countryCodeControl.field.value;
|
|
@@ -108,16 +109,29 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
108
109
|
};
|
|
109
110
|
var toggleCountryList = function () {
|
|
110
111
|
var _a, _b;
|
|
111
|
-
|
|
112
|
-
|
|
112
|
+
if (anchorEl) {
|
|
113
|
+
setAnchorEl(null);
|
|
114
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
(_b = rest.onListOpen) === null || _b === void 0 ? void 0 : _b.call(rest);
|
|
118
|
+
setAnchorEl(true);
|
|
119
|
+
}
|
|
113
120
|
};
|
|
114
121
|
var onSelectItem = function (country) {
|
|
115
122
|
onCloseCountryList();
|
|
116
123
|
setValue('mobile', '');
|
|
117
124
|
countryCodeControl.field.onChange(country);
|
|
118
125
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
var handleSearch = function (value) {
|
|
127
|
+
var filteredCountries = countries.filter(function (country) {
|
|
128
|
+
return country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
129
|
+
country.name.english.toLowerCase().startsWith(value.toLowerCase());
|
|
130
|
+
});
|
|
131
|
+
setCountries(filteredCountries);
|
|
132
|
+
};
|
|
133
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: requiredLen }, type: 'tel', onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
134
|
+
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, {})] }));
|
|
135
|
+
} })] }))] })) })));
|
|
122
136
|
});
|
|
123
137
|
export default React.memo(MobileNumber);
|
|
@@ -47,7 +47,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
49
|
import * as React from 'react';
|
|
50
|
-
import { useSelector } from 'react-redux';
|
|
51
50
|
import { useTranslation } from 'react-i18next';
|
|
52
51
|
import { useController, useFormContext } from 'react-hook-form';
|
|
53
52
|
import Box from '@mui/material/Box';
|
|
@@ -65,7 +64,7 @@ import Collapse from '../../../../components/Collapse';
|
|
|
65
64
|
import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
|
|
66
65
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
67
66
|
import { checkBrandNameAvailability, connectSelector } from '../../../app/connect/connectStore';
|
|
68
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
67
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
69
68
|
import { debounce } from 'lodash-es';
|
|
70
69
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
71
70
|
var theme = _a.theme;
|
|
@@ -108,7 +107,7 @@ var BrandName = function (_a) {
|
|
|
108
107
|
var brandControl = useController({ control: control, name: 'brandName' });
|
|
109
108
|
var brandNameValue = brandControl.field.value;
|
|
110
109
|
var error = (_b = brandControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
111
|
-
var data =
|
|
110
|
+
var data = useAppSelector(connectSelector).data;
|
|
112
111
|
var checkBrand = debounce(function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
113
112
|
var onSuccess;
|
|
114
113
|
return __generator(this, function (_a) {
|
|
@@ -11,12 +11,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import Collapse from '@mui/material/Collapse';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
18
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
19
|
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
21
20
|
import Form from '../../../../components/Form';
|
|
22
21
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -33,7 +32,7 @@ var Merchant = function (_a) {
|
|
|
33
32
|
var _e = React.useState(false), brandNameChecking = _e[0], setBrandNameChecking = _e[1];
|
|
34
33
|
var _f = React.useState(ValidationOptions.NEW_USER), userType = _f[0], setUserType = _f[1];
|
|
35
34
|
var _g = React.useState(false), listActive = _g[0], setListActive = _g[1];
|
|
36
|
-
var _h =
|
|
35
|
+
var _h = useAppSelector(connectSelector), data = _h.data, loading = _h.loading, error = _h.error;
|
|
37
36
|
var isNewUser = (_b = data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.new_user;
|
|
38
37
|
var isAbsher = data.otpData.isAbsher;
|
|
39
38
|
var brandList = ((_c = data.brandData.responseBody) === null || _c === void 0 ? void 0 : _c.brands) || [];
|
|
@@ -11,7 +11,6 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useSelector } from 'react-redux';
|
|
15
14
|
import Box from '@mui/material/Box';
|
|
16
15
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
17
16
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
@@ -20,7 +19,7 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
20
19
|
import Collapse from '../../../../components/Collapse';
|
|
21
20
|
import Form from '../../../../components/Form';
|
|
22
21
|
import Button, { AbsherButton } from '../../../shared/Button';
|
|
23
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
22
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
24
23
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
25
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
26
25
|
import { clearError, connectSelector, createMobileAuth } from '../../../app/connect/connectStore';
|
|
@@ -73,8 +72,8 @@ var ListType;
|
|
|
73
72
|
ListType["CountryCodeList"] = "CountryCodeList";
|
|
74
73
|
})(ListType || (ListType = {}));
|
|
75
74
|
var Mobile = function (_a) {
|
|
76
|
-
var settingsStore =
|
|
77
|
-
var _b =
|
|
75
|
+
var settingsStore = useAppSelector(settingsSelector);
|
|
76
|
+
var _b = useAppSelector(connectSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
78
77
|
var _c = React.useState(), listType = _c[0], setListType = _c[1];
|
|
79
78
|
var dispatch = useAppDispatch();
|
|
80
79
|
var methods = useForm({
|
|
@@ -31,11 +31,13 @@ import Collapse from '../../../../components/Collapse';
|
|
|
31
31
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
32
32
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
33
33
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
34
|
+
import { connectSelector } from '../../../app/connect/connectStore';
|
|
34
35
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
35
36
|
import Input from '../../../shared/Input';
|
|
36
37
|
import SimpleList from '../../../../components/SimpleList';
|
|
37
38
|
import { removeAllCharsFromNumber } from '../../../../utils';
|
|
38
|
-
import { useLanguage } from '../../../../hooks';
|
|
39
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
40
|
+
import Search from '../../../shared/Search';
|
|
39
41
|
var LabelContainerStyled = styled(Box)(function (_a) {
|
|
40
42
|
var theme = _a.theme;
|
|
41
43
|
return ({
|
|
@@ -74,11 +76,12 @@ var ExpandIconStyled = styled(ExpandIcon)(function (_a) {
|
|
|
74
76
|
var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
75
77
|
var _b, _c, _d;
|
|
76
78
|
var countries = _a.countries, rest = __rest(_a, ["countries"]);
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
+
var _e = React.useState(countries || []), countriesCode = _e[0], setCountries = _e[1];
|
|
80
|
+
var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
|
|
79
81
|
var t = useTranslation().t;
|
|
80
82
|
var isAr = useLanguage().isAr;
|
|
81
|
-
var
|
|
83
|
+
var _g = useFormContext(), control = _g.control, setValue = _g.setValue;
|
|
84
|
+
var loading = useAppSelector(connectSelector).loading;
|
|
82
85
|
var phoneControl = useController({ name: 'mobile', control: control });
|
|
83
86
|
var countryCodeControl = useController({ name: 'countryCode', control: control });
|
|
84
87
|
var countryCodeValue = countryCodeControl.field.value;
|
|
@@ -108,16 +111,29 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
108
111
|
};
|
|
109
112
|
var toggleCountryList = function () {
|
|
110
113
|
var _a, _b;
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
if (anchorEl) {
|
|
115
|
+
setAnchorEl(null);
|
|
116
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
(_b = rest.onListOpen) === null || _b === void 0 ? void 0 : _b.call(rest);
|
|
120
|
+
setAnchorEl(true);
|
|
121
|
+
}
|
|
113
122
|
};
|
|
114
123
|
var onSelectItem = function (country) {
|
|
115
124
|
onCloseCountryList();
|
|
116
125
|
setValue('mobile', '');
|
|
117
126
|
countryCodeControl.field.onChange(country);
|
|
118
127
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
var handleSearch = function (value) {
|
|
129
|
+
var filteredCountries = countries.filter(function (country) {
|
|
130
|
+
return country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
131
|
+
country.name.english.toLowerCase().startsWith(value.toLowerCase());
|
|
132
|
+
});
|
|
133
|
+
setCountries(filteredCountries);
|
|
134
|
+
};
|
|
135
|
+
return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(Input, { sx: { direction: 'ltr' }, inputProps: { maxLength: requiredLen }, type: 'tel', required: true, onChange: onPhoneNumberChange, onEnterPressed: function (e) { return loading && e.preventDefault(); }, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: !anchorEl ? error && t(error, { length: requiredLen, number: '05|5' }) : undefined }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleList, { list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
136
|
+
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, {})] }));
|
|
137
|
+
} })] }))] })) })));
|
|
122
138
|
});
|
|
123
139
|
export default React.memo(MobileNumber);
|
|
@@ -10,10 +10,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useSelector } from 'react-redux';
|
|
14
13
|
import { useTranslation } from 'react-i18next';
|
|
15
14
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
15
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
17
16
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
18
17
|
import DatePicker from '../../../../components/DatePicker';
|
|
19
18
|
import { alpha, styled } from '@mui/material/styles';
|
|
@@ -30,7 +29,7 @@ var DOB = function (_a) {
|
|
|
30
29
|
var control = useFormContext().control;
|
|
31
30
|
var dispatch = useAppDispatch();
|
|
32
31
|
var dobControl = useController({ control: control, name: 'dob' });
|
|
33
|
-
var error =
|
|
32
|
+
var error = useAppSelector(connectSelector).error;
|
|
34
33
|
var handleBirthDateChange = function (data) {
|
|
35
34
|
dobControl.field.onChange(data);
|
|
36
35
|
handleClearError();
|