@tap-payments/auth-jsconnect 1.0.61 → 1.0.65
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/redux.d.ts +1 -0
- package/build/api/lead.d.ts +4 -1
- package/build/assets/locales/ar.json +5 -3
- package/build/assets/locales/en.json +7 -5
- package/build/constants/assets.d.ts +19 -7
- package/build/constants/assets.js +19 -7
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +1 -1
- package/build/features/app/bank/bankStore.js +4 -0
- package/build/features/app/business/businessStore.d.ts +9 -2
- package/build/features/app/business/businessStore.js +133 -73
- package/build/features/app/connect/connectStore.js +18 -5
- package/build/features/app/individual/individualStore.js +4 -0
- package/build/features/app/password/passwordStore.js +6 -0
- package/build/features/app/tax/taxStore.js +6 -0
- package/build/features/business/Business.js +3 -2
- package/build/features/business/screens/Activities/Activities.js +4 -0
- package/build/features/business/screens/Activities/ActivitiesList.js +5 -6
- package/build/features/business/screens/Activities/SalesChannels.js +4 -5
- package/build/features/business/screens/BusinessType/BusinessType.js +1 -6
- package/build/features/business/screens/BusinessType/LicenseList.js +17 -12
- package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
- package/build/features/business/screens/BusinessType/validation.d.ts +3 -3
- package/build/features/business/screens/BusinessType/validation.js +14 -7
- package/build/features/business/screens/Customers/Customers.js +0 -1
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +0 -5
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +39 -35
- package/build/features/business/screens/Verify/Verify.js +1 -1
- package/build/features/password/screens/CreatePassword/CreatePassword.js +0 -1
- package/build/features/shared/Button/AbsherButton.js +23 -19
- package/build/features/shared/Button/Button.js +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
- package/build/features/shared/Button/FlowsButtons.d.ts +4 -3
- package/build/features/shared/Button/FlowsButtons.js +37 -20
- package/build/features/shared/Button/MobileButton.js +14 -11
- package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
- package/build/utils/string.d.ts +1 -0
- package/build/utils/string.js +4 -0
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import React, { memo, useEffect } from 'react';
|
|
|
14
14
|
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
|
|
15
15
|
import { settingsSelector } from '../../app/settings';
|
|
16
16
|
import { FeatureContainer } from '../shared/Containers';
|
|
17
|
-
import { getCountries, verifyLeadToken } from '../app/business/businessStore';
|
|
17
|
+
import { businessSelector, getCountries, verifyLeadToken } from '../app/business/businessStore';
|
|
18
18
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
19
19
|
import { store } from '../../app/store';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
@@ -28,6 +28,7 @@ var Business = memo(function (props) {
|
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
+
var customLoading = useAppSelector(businessSelector).customLoading;
|
|
31
32
|
var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
|
|
32
33
|
useErrorListener();
|
|
33
34
|
var activeScreen = data.activeScreen;
|
|
@@ -44,7 +45,7 @@ var Business = memo(function (props) {
|
|
|
44
45
|
useEffect(function () {
|
|
45
46
|
dispatch(getCountries());
|
|
46
47
|
}, []);
|
|
47
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
48
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
48
49
|
var Element = _a.element, name = _a.name;
|
|
49
50
|
var isActive = activeScreen.name === name;
|
|
50
51
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -61,6 +61,10 @@ var Activities = function () {
|
|
|
61
61
|
var activities = activitiesData.activities;
|
|
62
62
|
methods.setValue('activities', activities);
|
|
63
63
|
}, [activitiesData === null || activitiesData === void 0 ? void 0 : activitiesData.activities]);
|
|
64
|
+
React.useEffect(function () {
|
|
65
|
+
if (activitiesData.operationStartDate)
|
|
66
|
+
methods.setValue('operationStartDate', activitiesData.operationStartDate, { shouldValidate: true });
|
|
67
|
+
}, [activitiesData.operationStartDate]);
|
|
64
68
|
React.useEffect(function () {
|
|
65
69
|
if (error)
|
|
66
70
|
dispatch(clearError());
|
|
@@ -83,19 +83,18 @@ var ActivitiesList = function (_a) {
|
|
|
83
83
|
var t = useTranslation().t;
|
|
84
84
|
var isAr = useLanguage().isAr;
|
|
85
85
|
var control = useFormContext().control;
|
|
86
|
+
var data = useSelector(businessSelector).data;
|
|
86
87
|
var activitiesControl = useController({ name: 'activities', control: control });
|
|
87
88
|
var controlValue = activitiesControl.field.value;
|
|
88
|
-
var data = useSelector(businessSelector).data;
|
|
89
89
|
var businessTypeData = data.businessTypeData;
|
|
90
|
-
var
|
|
90
|
+
var activities = (businessTypeData.responseBody || {}).activities;
|
|
91
91
|
var businessType = (_b = businessTypeData.selectedLicense) === null || _b === void 0 ? void 0 : _b.type;
|
|
92
92
|
var isCR = businessType === BusinessType.CR;
|
|
93
93
|
React.useEffect(function () {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
setActivitiesMenuList(response === null || response === void 0 ? void 0 : response.activities);
|
|
94
|
+
if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0) {
|
|
95
|
+
setActivitiesMenuList(activities);
|
|
97
96
|
}
|
|
98
|
-
}, []);
|
|
97
|
+
}, [activities]);
|
|
99
98
|
var onOpenList = function (event) {
|
|
100
99
|
var _a;
|
|
101
100
|
setAnchorEl(event.currentTarget);
|
|
@@ -84,13 +84,12 @@ var SalesChannels = function () {
|
|
|
84
84
|
var channelsChecked = channelsControl.field.value;
|
|
85
85
|
var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
86
|
var data = useSelector(businessSelector).data;
|
|
87
|
-
var
|
|
87
|
+
var channelList = (data.businessTypeData.responseBody || {}).channelList;
|
|
88
88
|
React.useEffect(function () {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
setChannelsMenuList(response === null || response === void 0 ? void 0 : response.channelList);
|
|
89
|
+
if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
|
|
90
|
+
setChannelsMenuList(channelList);
|
|
92
91
|
}
|
|
93
|
-
}, [
|
|
92
|
+
}, [channelList]);
|
|
94
93
|
var handleSalesChannelChange = function (event, checked) {
|
|
95
94
|
var selected = channelsMenuList.find(function (channel) { return channel.id.toString() === event.target.id; });
|
|
96
95
|
var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
@@ -21,13 +21,12 @@ import Form from '../../../../components/Form';
|
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
22
|
import { useLanguage } from '../../../../hooks';
|
|
23
23
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
24
|
-
import { businessSelector, clearError,
|
|
24
|
+
import { businessSelector, clearError, updateLeadBusinessType } from '../../../app/business/businessStore';
|
|
25
25
|
import Button from '../../../shared/Button';
|
|
26
26
|
import { LicenseValidationSchema } from './validation';
|
|
27
27
|
import LicenseList from './LicenseList';
|
|
28
28
|
var BusinessType = function (_a) {
|
|
29
29
|
var _b = useSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error;
|
|
30
|
-
var businessTypeData = data.businessTypeData;
|
|
31
30
|
var t = useTranslation().t;
|
|
32
31
|
var isAr = useLanguage().isAr;
|
|
33
32
|
var dispatch = useAppDispatch();
|
|
@@ -37,10 +36,6 @@ var BusinessType = function (_a) {
|
|
|
37
36
|
defaultValues: data.businessTypeData,
|
|
38
37
|
mode: 'onChange'
|
|
39
38
|
});
|
|
40
|
-
React.useEffect(function () {
|
|
41
|
-
if (!(businessTypeData === null || businessTypeData === void 0 ? void 0 : businessTypeData.responseBody))
|
|
42
|
-
dispatch(retrieveEntityList());
|
|
43
|
-
}, []);
|
|
44
39
|
React.useEffect(function () {
|
|
45
40
|
if (error)
|
|
46
41
|
dispatch(clearError());
|
|
@@ -52,7 +52,7 @@ var LicenseContainer = styled(Box)(function () { return ({
|
|
|
52
52
|
}); });
|
|
53
53
|
var LicenseNameText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
54
54
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
55
|
-
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
55
|
+
return (__assign(__assign({ display: 'flex', color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight }));
|
|
56
56
|
});
|
|
57
57
|
var LicenseList = function (_a) {
|
|
58
58
|
var rest = __rest(_a, []);
|
|
@@ -64,7 +64,7 @@ var LicenseList = function (_a) {
|
|
|
64
64
|
var dispatch = useAppDispatch();
|
|
65
65
|
var _d = useFormContext(), setValue = _d.setValue, control = _d.control;
|
|
66
66
|
var selectedLicenseControl = useController({ control: control, name: 'selectedLicense' });
|
|
67
|
-
var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense;
|
|
67
|
+
var responseBody = businessTypeData.responseBody, selectedLicense = businessTypeData.selectedLicense, licenseNumber = businessTypeData.licenseNumber;
|
|
68
68
|
var licenseList = (responseBody || { licenseList: [] }).licenseList;
|
|
69
69
|
var onOpenLicenseList = function (event) {
|
|
70
70
|
var _a;
|
|
@@ -77,12 +77,14 @@ var LicenseList = function (_a) {
|
|
|
77
77
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
78
78
|
};
|
|
79
79
|
React.useEffect(function () {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
if (licenseList.length > 0)
|
|
81
|
+
setValue('licenseList', licenseList);
|
|
82
|
+
}, [licenseList]);
|
|
83
|
+
React.useEffect(function () {
|
|
84
|
+
if (licenseList.length > 0) {
|
|
83
85
|
if (!!selectedLicense) {
|
|
84
86
|
setValue('selectedLicense', selectedLicense, { shouldValidate: true });
|
|
85
|
-
setValue('licenseNumber',
|
|
87
|
+
setValue('licenseNumber', licenseNumber, { shouldValidate: true });
|
|
86
88
|
}
|
|
87
89
|
}
|
|
88
90
|
}, [licenseList, selectedLicense]);
|
|
@@ -93,8 +95,8 @@ var LicenseList = function (_a) {
|
|
|
93
95
|
var getLicenseName = function (item) {
|
|
94
96
|
var _a, _b;
|
|
95
97
|
if ((item === null || item === void 0 ? void 0 : item.type) === BusinessType.FL && !isOtherLicense(item))
|
|
96
|
-
return 'future_work';
|
|
97
|
-
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) || '';
|
|
98
|
+
return t('future_work');
|
|
99
|
+
return t((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) || '');
|
|
98
100
|
};
|
|
99
101
|
var isOtherLicense = function (item) {
|
|
100
102
|
var _a, _b;
|
|
@@ -110,15 +112,18 @@ var LicenseList = function (_a) {
|
|
|
110
112
|
setValue('licenseNumber', getLicenseNumber(license), { shouldValidate: true });
|
|
111
113
|
onCloseLicenseList();
|
|
112
114
|
};
|
|
115
|
+
var getLicenseFullName = function (item) {
|
|
116
|
+
if (isAr)
|
|
117
|
+
return _jsx("span", { children: "".concat(getLicenseName(item), " - ").concat(getLicenseNumber(item)) });
|
|
118
|
+
return _jsx("span", { children: "".concat(getLicenseNumber(item), " - ").concat(getLicenseName(item)) });
|
|
119
|
+
};
|
|
113
120
|
var showLicenseNumber = !anchorEl;
|
|
114
121
|
var selected = selectedLicenseControl.field.value;
|
|
115
122
|
var licenseReadonly = !isOtherLicense(selected);
|
|
116
123
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
|
|
117
|
-
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) :
|
|
124
|
+
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
|
|
118
125
|
return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
119
|
-
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item)
|
|
120
|
-
? t(getLicenseName(item))
|
|
121
|
-
: getLicenseNumber(item) + ' - ' + getLicenseName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
|
|
126
|
+
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
|
|
122
127
|
} }) })), _jsx(LicenseNumber, { show: showLicenseNumber, readOnly: licenseReadonly })] }));
|
|
123
128
|
};
|
|
124
129
|
export default React.memo(LicenseList);
|
|
@@ -14,7 +14,7 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import { CR_NUMBER_LENGTH, FL_NUMBER_LENGTH } from '../../../../constants';
|
|
17
|
-
import {
|
|
17
|
+
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
18
18
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
19
19
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
20
20
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
@@ -31,7 +31,7 @@ var LicenseNumber = function (_a) {
|
|
|
31
31
|
var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
|
|
32
32
|
var handleFLNumberChange = function (_a) {
|
|
33
33
|
var target = _a.target;
|
|
34
|
-
var value =
|
|
34
|
+
var value = removeAllOtherThanCharsAndNumber(target.value);
|
|
35
35
|
licenseNumberControl.field.onChange(value);
|
|
36
36
|
};
|
|
37
37
|
var clearLicenseNumber = function () {
|
|
@@ -41,6 +41,6 @@ var LicenseNumber = function (_a) {
|
|
|
41
41
|
var error = (_b = licenseNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
42
42
|
var length = isCR ? CR_NUMBER_LENGTH : FL_NUMBER_LENGTH;
|
|
43
43
|
var label = isCR ? 'cr_number' : 'fl_number';
|
|
44
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length ? (_jsx(CheckIcon, {})) : (licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber })), placeholder: isCR ? '
|
|
44
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t(label), onChange: handleFLNumberChange, inputProps: { maxLength: length }, value: licenseNumberValue, endAdornment: (licenseNumberValue === null || licenseNumberValue === void 0 ? void 0 : licenseNumberValue.length) === length ? (_jsx(CheckIcon, {})) : (licenseNumberValue && _jsx(ClearIcon, { onClick: clearLicenseNumber })), placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: length }) }) }) })));
|
|
45
45
|
};
|
|
46
46
|
export default React.memo(LicenseNumber);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export declare const LicenseValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
3
|
selectedLicense: any;
|
|
4
|
-
licenseNumber: yup.
|
|
4
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
5
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
6
6
|
selectedLicense: any;
|
|
7
|
-
licenseNumber: yup.
|
|
7
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
8
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
9
9
|
selectedLicense: any;
|
|
10
|
-
licenseNumber: yup.
|
|
10
|
+
licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
11
|
}>>>;
|
|
@@ -13,13 +13,20 @@ var objectElements = {
|
|
|
13
13
|
};
|
|
14
14
|
export var LicenseValidationSchema = yup.object().shape({
|
|
15
15
|
selectedLicense: yup.object().shape(objectElements).required(''),
|
|
16
|
-
licenseNumber: yup
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
licenseNumber: yup
|
|
17
|
+
.string()
|
|
18
|
+
.test({
|
|
19
|
+
test: function (value) {
|
|
20
|
+
var selectedLicense = this.parent.selectedLicense;
|
|
21
|
+
var isCR = (selectedLicense === null || selectedLicense === void 0 ? void 0 : selectedLicense.type) === BusinessType.CR;
|
|
22
|
+
var length = (value === null || value === void 0 ? void 0 : value.length) || 0;
|
|
23
|
+
if (length === 0)
|
|
24
|
+
return true;
|
|
25
|
+
if (isCR) {
|
|
26
|
+
return length === CR_NUMBER_LENGTH ? true : this.createError({ message: 'cr_max_length' });
|
|
27
|
+
}
|
|
28
|
+
return length === FL_NUMBER_LENGTH ? true : this.createError({ message: 'fl_max_length' });
|
|
23
29
|
}
|
|
24
30
|
})
|
|
31
|
+
.required('')
|
|
25
32
|
});
|
|
@@ -67,11 +67,6 @@ var ExpectedSalesRange = function (_a) {
|
|
|
67
67
|
setExpectedSalesRangeList(response === null || response === void 0 ? void 0 : response.expectedSales);
|
|
68
68
|
}
|
|
69
69
|
}, [response === null || response === void 0 ? void 0 : response.expectedSales]);
|
|
70
|
-
var checkRemainingCondition = function (item) {
|
|
71
|
-
return !!expectedSalesRangeValue.find(function (expectedSale) {
|
|
72
|
-
return expectedSale.id === item.id;
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
70
|
var onSelectItem = function (expectedSalesRange) {
|
|
76
71
|
onCloseList();
|
|
77
72
|
expectedSalesRangeControl.field.onChange(expectedSalesRange);
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { memo } from 'react';
|
|
13
|
+
import { memo, useEffect, useState } from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { styled } from '@mui/material/styles';
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
@@ -18,20 +18,18 @@ import Text from '../../../../components/Text';
|
|
|
18
18
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
19
19
|
import { FlowsButtons } from '../../../shared/Button';
|
|
20
20
|
import { ICONS_NAMES } from '../../../../constants';
|
|
21
|
+
import { useAppSelector } from '../../../../hooks';
|
|
22
|
+
import { businessSelector } from '../../../app/business/businessStore';
|
|
21
23
|
var TextContainerStyled = styled(Box)(function (_a) {
|
|
22
|
-
var _b;
|
|
23
24
|
var theme = _a.theme;
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
marginBottom: theme.spacing(7.5)
|
|
33
|
-
},
|
|
34
|
-
_b);
|
|
25
|
+
return ({
|
|
26
|
+
background: theme.palette.common.white,
|
|
27
|
+
border: '1px solid',
|
|
28
|
+
width: '100%',
|
|
29
|
+
borderColor: theme.palette.divider,
|
|
30
|
+
borderRadius: theme.spacing(0, 0, 1.25, 1.25),
|
|
31
|
+
marginBottom: theme.spacing(7.5)
|
|
32
|
+
});
|
|
35
33
|
});
|
|
36
34
|
var TitleStyled = styled(Text)(function (_a) {
|
|
37
35
|
var theme = _a.theme;
|
|
@@ -53,27 +51,33 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
|
|
|
53
51
|
});
|
|
54
52
|
var SuccessWithFlowButtons = function () {
|
|
55
53
|
var t = useTranslation().t;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
54
|
+
var data = useAppSelector(businessSelector).data;
|
|
55
|
+
var _a = data.verify.responseBody || {}, flows = _a.flows, nameObj = _a.name;
|
|
56
|
+
var _b = useState([]), buttons = _b[0], setButtons = _b[1];
|
|
57
|
+
var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
|
|
58
|
+
var reMapFlowData = function (flows) {
|
|
59
|
+
if (flows === void 0) { flows = []; }
|
|
60
|
+
var images = ICONS_NAMES;
|
|
61
|
+
var mappedFlows = flows.map(function (_a) {
|
|
62
|
+
var name = _a.name, url = _a.url, status = _a.status;
|
|
63
|
+
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
64
|
+
var title = t("".concat(name, "_flow_").concat(type), { individual_name: username });
|
|
65
|
+
var src = "".concat(name, "_filled_icon");
|
|
66
|
+
var hoverSrc = "".concat(name, "_white_icon");
|
|
67
|
+
return {
|
|
68
|
+
title: title,
|
|
69
|
+
href: url,
|
|
70
|
+
src: images[src],
|
|
71
|
+
hoverSrc: images[hoverSrc],
|
|
72
|
+
isCompleted: status === 'completed'
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
setButtons(mappedFlows);
|
|
76
|
+
};
|
|
77
|
+
useEffect(function () {
|
|
78
|
+
if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
|
|
79
|
+
reMapFlowData(flows);
|
|
80
|
+
}, [flows]);
|
|
81
|
+
return (_jsxs(ContainerStyled, { children: [_jsx(TextContainerStyled, { children: _jsxs(TitleStyled, { children: [t('ide_successfully_verified_message'), " "] }) }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons }) })] }));
|
|
78
82
|
};
|
|
79
83
|
export default memo(SuccessWithFlowButtons);
|
|
@@ -59,7 +59,7 @@ var VerifyNumber = function (_a) {
|
|
|
59
59
|
var t = useTranslation().t;
|
|
60
60
|
var isAr = useLanguage().isAr;
|
|
61
61
|
React.useEffect(function () {
|
|
62
|
-
if (error)
|
|
62
|
+
if (error && methods.formState.isValid)
|
|
63
63
|
dispatch(clearError());
|
|
64
64
|
return function () {
|
|
65
65
|
dispatch(resetOTPScreen());
|
|
@@ -43,7 +43,6 @@ var CreatePassword = function (_a) {
|
|
|
43
43
|
var isAr = useLanguage().isAr;
|
|
44
44
|
var dispatch = useAppDispatch();
|
|
45
45
|
var onSubmit = function (data) {
|
|
46
|
-
console.log('data', data);
|
|
47
46
|
dispatch(handleNextScreenStep());
|
|
48
47
|
};
|
|
49
48
|
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: true, isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') }))] })) })) }));
|
|
@@ -21,18 +21,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import React from 'react';
|
|
24
25
|
import Button from '../../../components/Button';
|
|
25
26
|
import Icon from '../../../components/Icon';
|
|
26
27
|
import { alpha, styled } from '@mui/material/styles';
|
|
27
28
|
import Box from '@mui/material/Box';
|
|
28
29
|
import { ICONS_NAMES } from '../../../constants';
|
|
29
|
-
var IconStyled = styled(Icon)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
marginInlineStart: theme.spacing(0.75)
|
|
35
|
-
});
|
|
30
|
+
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
|
|
31
|
+
var theme = _a.theme, disabled = _a.disabled;
|
|
32
|
+
return (__assign({ width: theme.spacing(3), height: theme.spacing(3), marginInlineStart: theme.spacing(0.75) }, (disabled && {
|
|
33
|
+
opacity: 0.3
|
|
34
|
+
})));
|
|
36
35
|
});
|
|
37
36
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
38
37
|
var theme = _a.theme;
|
|
@@ -40,30 +39,35 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
|
40
39
|
margin: theme.spacing(0, 2.5, 2.5, 2.5)
|
|
41
40
|
});
|
|
42
41
|
});
|
|
43
|
-
var ButtonStyled = styled(Button, {
|
|
44
|
-
|
|
42
|
+
var ButtonStyled = styled(Button, {
|
|
43
|
+
shouldForwardProp: function (prop) { return prop !== 'hideIcon' && prop !== 'touched'; }
|
|
44
|
+
})(function (_a) {
|
|
45
|
+
var theme = _a.theme, hideIcon = _a.hideIcon, touched = _a.touched;
|
|
45
46
|
return ({
|
|
46
47
|
paddingInlineStart: theme.spacing(0.75),
|
|
47
|
-
|
|
48
|
+
textTransform: 'none',
|
|
49
|
+
backgroundColor: touched ? theme.palette.primary.light : theme.palette.common.white,
|
|
48
50
|
border: "1px solid ".concat(hideIcon ? theme.palette.primary.main : theme.palette.primary.light),
|
|
49
|
-
color: hideIcon ? theme.palette.primary.main : theme.palette.primary.light,
|
|
51
|
+
color: hideIcon ? theme.palette.primary.main : touched ? theme.palette.common.white : theme.palette.primary.light,
|
|
50
52
|
'&:hover': {
|
|
51
|
-
backgroundColor:
|
|
52
|
-
color: theme.palette.common.white,
|
|
53
|
+
backgroundColor: touched ? theme.palette.primary.light : theme.palette.common.white,
|
|
54
|
+
color: hideIcon ? theme.palette.primary.main : touched ? theme.palette.common.white : theme.palette.primary.light,
|
|
53
55
|
img: {
|
|
54
|
-
filter: 'brightness(0) invert(1)'
|
|
56
|
+
filter: touched ? 'brightness(0) invert(1)' : ''
|
|
55
57
|
}
|
|
56
58
|
},
|
|
57
|
-
'&:active': {
|
|
58
|
-
backgroundColor: theme.palette.common.white
|
|
59
|
-
},
|
|
60
59
|
'&:disabled': {
|
|
61
60
|
backgroundColor: theme.palette.common.white,
|
|
62
|
-
color: hideIcon ?
|
|
61
|
+
color: alpha(hideIcon ? theme.palette.primary.main : theme.palette.primary.light, 0.3),
|
|
62
|
+
border: "1px solid ".concat(alpha(hideIcon ? theme.palette.primary.main : theme.palette.primary.light, 0.3))
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
export default function AbsherButton(_a) {
|
|
67
67
|
var children = _a.children, isAr = _a.isAr, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "isAr", "hideIcon", "disabled"]);
|
|
68
|
-
|
|
68
|
+
var _b = React.useState(false), touched = _b[0], setTouched = _b[1];
|
|
69
|
+
var handleTouch = function () {
|
|
70
|
+
setTouched(true);
|
|
71
|
+
};
|
|
72
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ onTouchStart: handleTouch, touched: touched, hideIcon: hideIcon, disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
|
|
69
73
|
}
|
|
@@ -63,7 +63,7 @@ var ButtonStyled = styled(Button, {
|
|
|
63
63
|
shouldForwardProp: function (prop) { return prop !== 'isBack' && prop !== 'isLoading'; }
|
|
64
64
|
})(function (_a) {
|
|
65
65
|
var theme = _a.theme, isBack = _a.isBack, isLoading = _a.isLoading;
|
|
66
|
-
return (__assign({ paddingInlineStart: theme.spacing(2.5), marginInlineStart: isBack ? theme.spacing(-5) : theme.spacing(0), paddingLeft: isLoading ? 8 : 'auto', paddingRight: isLoading ? 8 : 'auto', transition: theme.transitions.create(['width', 'padding'], {
|
|
66
|
+
return (__assign({ paddingInlineStart: theme.spacing(2.5), marginInlineStart: isBack ? theme.spacing(-5) : theme.spacing(0), paddingLeft: isLoading ? 8 : 'auto', paddingRight: isLoading ? 8 : 'auto', textTransform: 'none', transition: theme.transitions.create(['width', 'padding'], {
|
|
67
67
|
easing: theme.transitions.easing.easeInOut,
|
|
68
68
|
duration: theme.transitions.duration.complex * 2
|
|
69
69
|
}) }, (isLoading && {
|
|
@@ -10,6 +10,7 @@ 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 React from 'react';
|
|
13
14
|
import Button from '../../../components/Button';
|
|
14
15
|
import { alpha, styled } from '@mui/material/styles';
|
|
15
16
|
import Box from '@mui/material/Box';
|
|
@@ -34,6 +35,7 @@ var GMailButtonStyled = styled(Button)(function (_a) {
|
|
|
34
35
|
var theme = _a.theme;
|
|
35
36
|
return ({
|
|
36
37
|
width: '100%',
|
|
38
|
+
textTransform: 'none',
|
|
37
39
|
paddingInlineStart: theme.spacing(0.75),
|
|
38
40
|
marginBottom: theme.spacing(1.875),
|
|
39
41
|
backgroundColor: theme.palette.common.white,
|
|
@@ -53,8 +55,8 @@ var OutlookButtonStyled = styled(Button)(function (_a) {
|
|
|
53
55
|
var theme = _a.theme;
|
|
54
56
|
return ({
|
|
55
57
|
width: '100%',
|
|
58
|
+
textTransform: 'none',
|
|
56
59
|
paddingInlineStart: theme.spacing(0.75),
|
|
57
|
-
marginBottom: theme.spacing(1.875),
|
|
58
60
|
backgroundColor: theme.palette.common.white,
|
|
59
61
|
border: "1px solid ".concat(theme.palette.primary.main),
|
|
60
62
|
color: theme.palette.primary.main,
|
|
@@ -72,9 +74,11 @@ var AppleButtonStyled = styled(Button)(function (_a) {
|
|
|
72
74
|
var theme = _a.theme;
|
|
73
75
|
return ({
|
|
74
76
|
width: '100%',
|
|
77
|
+
textTransform: 'none',
|
|
75
78
|
paddingInlineStart: theme.spacing(0.75),
|
|
76
79
|
backgroundColor: theme.palette.common.white,
|
|
77
80
|
border: "1px solid ".concat(theme.palette.primary.main),
|
|
81
|
+
marginBottom: theme.spacing(1.875),
|
|
78
82
|
color: theme.palette.primary.main,
|
|
79
83
|
'&:hover': {
|
|
80
84
|
backgroundColor: theme.palette.primary.main,
|
|
@@ -88,5 +92,6 @@ var AppleButtonStyled = styled(Button)(function (_a) {
|
|
|
88
92
|
});
|
|
89
93
|
export default function EmailProvidersButtons(_a) {
|
|
90
94
|
var gmail = _a.gmail, outlook = _a.outlook, apple = _a.apple;
|
|
91
|
-
|
|
95
|
+
var _b = React.useState(), index = _b[0], setIndex = _b[1];
|
|
96
|
+
return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(0); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(GMailButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 0 ? ICONS_NAMES.GMAIL_White_ICON : ICONS_NAMES.GMAIL_Filled_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(1); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(AppleButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 1 ? ICONS_NAMES.apple_white_icon : ICONS_NAMES.Apple_Filled_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank', onMouseEnter: function () { return setIndex(2); }, onMouseLeave: function () { return setIndex(undefined); } }, { children: _jsx(OutlookButtonStyled, __assign({ startIcon: _jsx(Image, { src: index === 2 ? ICONS_NAMES.outlook_White_ICON : ICONS_NAMES.outlook_Filled_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
|
|
92
97
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ButtonProps } from '../../../components/Button';
|
|
3
|
-
declare type
|
|
3
|
+
export declare type ButtonItemProps = {
|
|
4
4
|
title: string;
|
|
5
5
|
href: string;
|
|
6
6
|
src: string;
|
|
7
|
+
hoverSrc: string;
|
|
8
|
+
isCompleted: boolean;
|
|
7
9
|
};
|
|
8
10
|
export interface EmailProvidersButtonsProps extends ButtonProps {
|
|
9
|
-
buttons:
|
|
11
|
+
buttons: ButtonItemProps[];
|
|
10
12
|
}
|
|
11
13
|
export default function FlowsButtons({ buttons }: EmailProvidersButtonsProps): JSX.Element;
|
|
12
|
-
export {};
|