@tap-payments/auth-jsconnect 2.0.58-test → 2.0.60-test
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/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/features/app/connect/connectStore.js +5 -6
- package/build/features/connect/screens/Mobile/Mobile.js +3 -2
- package/build/features/shared/Button/MobileButton.d.ts +2 -1
- package/build/features/shared/Button/MobileButton.js +2 -2
- package/package.json +1 -1
|
@@ -58,6 +58,7 @@ export var ICONS_NAMES = {
|
|
|
58
58
|
DOC_ICON: 'https://dash.b-cdn.net/icons/menu/document-icon.svg',
|
|
59
59
|
DROP_FILE_ICON: 'https://dash.b-cdn.net/icons/menu/upload-file-sample.svg',
|
|
60
60
|
CLOSE_ICON: 'https://dash.b-cdn.net/icons/menu/close-btn.svg',
|
|
61
|
+
PACI_ICON: 'https://dash.b-cdn.net/icons/menu/PACI-filled.svg',
|
|
61
62
|
GMAIL_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-filled.svg',
|
|
62
63
|
GMAIL_White_ICON: 'https://dash.b-cdn.net/icons/menu/Gmail-white.svg',
|
|
63
64
|
outlook_Filled_ICON: 'https://dash.b-cdn.net/icons/menu/Outlook-filled.svg',
|
|
@@ -288,7 +288,7 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
|
|
|
288
288
|
case 2:
|
|
289
289
|
data = _f.sent();
|
|
290
290
|
response = data;
|
|
291
|
-
if (count === 1) {
|
|
291
|
+
if (count === 1 && (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) === false) {
|
|
292
292
|
thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id));
|
|
293
293
|
thunkApi.dispatch(retrieveChannels());
|
|
294
294
|
}
|
|
@@ -297,14 +297,14 @@ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkAp
|
|
|
297
297
|
return [4, ((_c = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _c === void 0 ? void 0 : _c.call(params))];
|
|
298
298
|
case 3:
|
|
299
299
|
_f.sent();
|
|
300
|
-
if (responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) {
|
|
300
|
+
if ((responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user) && (data === null || data === void 0 ? void 0 : data.lead_id)) {
|
|
301
301
|
leadBody = {
|
|
302
302
|
leadId: data === null || data === void 0 ? void 0 : data.lead_id,
|
|
303
303
|
stepName: 'CONNECT_INDIVIDUAL_STEP'
|
|
304
304
|
};
|
|
305
305
|
thunkApi.dispatch(retrieveLead(leadBody));
|
|
306
306
|
}
|
|
307
|
-
else if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
|
|
307
|
+
else if (!(data === null || data === void 0 ? void 0 : data.lead_id) && (data === null || data === void 0 ? void 0 : data.individual_id)) {
|
|
308
308
|
leadBody = {
|
|
309
309
|
individualId: data === null || data === void 0 ? void 0 : data.individual_id,
|
|
310
310
|
stepName: 'CONNECT_MERCHANT_INFO_STEP'
|
|
@@ -390,20 +390,19 @@ export var retrieveChannels = createAsyncThunk('retrieveChannels', function () {
|
|
|
390
390
|
});
|
|
391
391
|
}); });
|
|
392
392
|
export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
393
|
-
var _a, settings, connect,
|
|
393
|
+
var _a, settings, connect, payload, data;
|
|
394
394
|
var _b, _c, _d, _e, _f, _g;
|
|
395
395
|
return __generator(this, function (_h) {
|
|
396
396
|
switch (_h.label) {
|
|
397
397
|
case 0:
|
|
398
398
|
_a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
|
|
399
|
-
isAbsher = connect.data.otpData.isAbsher;
|
|
400
399
|
payload = {
|
|
401
400
|
name: getIndividualName(params.name),
|
|
402
401
|
id: ((_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '',
|
|
403
402
|
country_code: (_c = settings.data.businessCountry) === null || _c === void 0 ? void 0 : _c.iso2,
|
|
404
403
|
contact: {
|
|
405
404
|
email: params.email,
|
|
406
|
-
phone:
|
|
405
|
+
phone: !!params.mobile
|
|
407
406
|
? {
|
|
408
407
|
country_code: (_e = (_d = params.countryCode) === null || _d === void 0 ? void 0 : _d.idd_prefix) === null || _e === void 0 ? void 0 : _e.toString(),
|
|
409
408
|
number: params.mobile || ''
|
|
@@ -18,7 +18,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
18
18
|
import { styled, alpha } from '@mui/material/styles';
|
|
19
19
|
import Collapse from '../../../../components/Collapse';
|
|
20
20
|
import Form from '../../../../components/Form';
|
|
21
|
-
import Button, { AbsherButton } from '../../../shared/Button';
|
|
21
|
+
import Button, { AbsherButton, MobileButton } from '../../../shared/Button';
|
|
22
22
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
23
23
|
import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
|
|
24
24
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
@@ -30,6 +30,7 @@ import Text from '../../../../components/Text';
|
|
|
30
30
|
import MIDTitle from './Title';
|
|
31
31
|
import MobileNumber from './MobileNumber';
|
|
32
32
|
import { PhoneValidationSchema } from './validation';
|
|
33
|
+
import { ICONS_NAMES } from '../../../../constants';
|
|
33
34
|
var FormStyled = styled(Form)(function () { return ({
|
|
34
35
|
display: 'flex',
|
|
35
36
|
flexDirection: 'column'
|
|
@@ -112,6 +113,6 @@ var Mobile = function (_a) {
|
|
|
112
113
|
var disabled = !methods.formState.isValid || !!error;
|
|
113
114
|
var title = t('join_our_community');
|
|
114
115
|
var subTitle = t('ide_terms_and_conditions_description');
|
|
115
|
-
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(
|
|
116
|
+
return (_jsxs(ScreenContainer, { children: [(title || subTitle) && _jsx(MIDTitle, { show: !listActive, title: title, description: subTitle }), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { show: !isBusinessListActive, countries: settingsStore.data.countries, onListOpen: function () { return handleMenuListClick(ListType.CountryCodeList); }, onListClose: function () { return handleMenuListClick(); } }) }), _jsxs(Collapse, __assign({ in: !listActive }, { children: [_jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: true, disabled: disabled || settingsStore.loading, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKWCountry ? (_jsx(MobileButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: settingsStore.loading || loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) }))] }));
|
|
116
117
|
};
|
|
117
118
|
export default React.memo(Mobile);
|
|
@@ -3,6 +3,7 @@ import { ButtonProps } from '../../../components/Button';
|
|
|
3
3
|
interface MobileButtonProps extends ButtonProps {
|
|
4
4
|
loading?: boolean;
|
|
5
5
|
hideIcon?: boolean;
|
|
6
|
+
icon?: string;
|
|
6
7
|
}
|
|
7
|
-
export default function MobileButton({ children, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
|
|
8
|
+
export default function MobileButton({ children, hideIcon, icon, disabled, ...props }: MobileButtonProps): JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -39,6 +39,6 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
41
|
export default function MobileButton(_a) {
|
|
42
|
-
var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
|
|
43
|
-
return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
|
|
42
|
+
var children = _a.children, hideIcon = _a.hideIcon, icon = _a.icon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "icon", "disabled"]);
|
|
43
|
+
return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: !!icon ? icon : ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
|
|
44
44
|
}
|