@tap-payments/auth-jsconnect 2.6.92-test → 2.6.93-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.
@@ -136,7 +136,7 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
136
136
  },
137
137
  {
138
138
  name: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
139
- next: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
139
+ next: ['CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP', 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP'],
140
140
  prev: ['CONNECT_EXPRESS_MOBILE_STEP', 'CONNECT_EXPRESS_NID_STEP', 'CONNECT_EXPRESS_CIVIL_ID_STEP'],
141
141
  order: 3
142
142
  },
@@ -152,6 +152,12 @@ export var CONNECT_EXPRESS_SCREENS_NAVIGATION = [
152
152
  prev: 'CONNECT_EXPRESS_MOBILE_STEP',
153
153
  order: 3
154
154
  },
155
+ {
156
+ name: 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP',
157
+ next: '',
158
+ prev: 'CONNECT_EXPRESS_AUTHENTICATION_LIST_STEP',
159
+ order: 4
160
+ },
155
161
  {
156
162
  name: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
157
163
  next: 'CONNECT_EXPRESS_SUCCESS_WITH_FLOW_BUTTONS_STEP',
@@ -232,12 +232,10 @@ export var getMerchantListAsync = createAsyncThunk('connectExpress/getMerchantLi
232
232
  merchants = (_b.sent()).merchants;
233
233
  list = merchants || [];
234
234
  if ((list === null || list === void 0 ? void 0 : list.length) > 1) {
235
- thunkApi.dispatch(handleNextScreenStep());
235
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP'));
236
236
  return [2, { list: list, brandInfo: brandInfo, entityInfo: entityInfo }];
237
237
  }
238
- return [4, thunkApi.dispatch(confirmInfo({ entityInfo: entityInfo, brandInfo: brandInfo, merchantInfo: list === null || list === void 0 ? void 0 : list[0] }))];
239
- case 2:
240
- _b.sent();
238
+ sleep(50).then(function () { return thunkApi.dispatch(handleNextScreenStep('CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP')); });
241
239
  return [2, { list: list, brandInfo: brandInfo, entityInfo: entityInfo }];
242
240
  }
243
241
  });
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface AccountCreatedLoaderProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: AccountCreatedLoaderProps) => import("react/jsx-runtime").JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,36 @@
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 { isNetworkError } from '../../../../utils';
16
+ import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
17
+ import { confirmInfo, connectExpressSelector } from '../../../app/connectExpress/connectExpressStore';
18
+ import Button from '../../../shared/Button';
19
+ import DataLoading from '../../../shared/DataLoading';
20
+ var AccountCreatedLoader = function (_a) {
21
+ var dispatch = useAppDispatch();
22
+ var isAr = useLanguage().isAr;
23
+ var t = useTranslation().t;
24
+ var _b = useAppSelector(connectExpressSelector), error = _b.error, loading = _b.loading, data = _b.data;
25
+ var _c = data.authenticationData, brandInfo = _c.brandInfo, entityInfo = _c.entityInfo;
26
+ var merchantInfo = data.authMerchantData.merchantInfo;
27
+ React.useEffect(function () {
28
+ dispatch(confirmInfo({ entityInfo: entityInfo, brandInfo: brandInfo, merchantInfo: merchantInfo }));
29
+ }, []);
30
+ var onReTry = function () {
31
+ dispatch(confirmInfo({ entityInfo: entityInfo, brandInfo: brandInfo, merchantInfo: merchantInfo }));
32
+ };
33
+ var isNE = React.useMemo(function () { return isNetworkError(error); }, [error]);
34
+ return (_jsx(DataLoading, __assign({ error: error, title: 'account_already_created', hideSubtitle: true }, { children: isNE && (_jsx(Button, __assign({ onClick: onReTry, disableBack: true, isAr: isAr, loading: loading }, { children: t('try_again') }))) })));
35
+ };
36
+ export default React.memo(AccountCreatedLoader);
@@ -0,0 +1,2 @@
1
+ import AccountCreatedLoader from './AccountCreatedLoader';
2
+ export default AccountCreatedLoader;
@@ -0,0 +1,2 @@
1
+ import AccountCreatedLoader from './AccountCreatedLoader';
2
+ export default AccountCreatedLoader;
@@ -26,6 +26,7 @@ import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/Suc
26
26
  import ConnectExpressAccountAlreadyCreatedScreen from './connectExpress/screens/AccountAlreadyCreated';
27
27
  import ConnectExpressAuthenticationListScreen from './connectExpress/screens/AuthenticationList';
28
28
  import ConnectExpressAuthMerchantScreen from './connectExpress/screens/AuthMerchant';
29
+ import ConnectExpressAuthAccountCreatedLoaderScreen from './connectExpress/screens/AccountCreatedLoader';
29
30
  import AuthBusinessCountry from './auth/screens/BusinessCountry/BusinessCountry';
30
31
  import AuthMobileScreen from './auth/screens/Mobile';
31
32
  import AuthNIDScreen from './auth/screens/NID';
@@ -210,6 +211,10 @@ export var connectExpressFeatureScreens = [
210
211
  {
211
212
  name: 'CONNECT_EXPRESS_AUTH_MERCHANT_LIST_STEP',
212
213
  element: ConnectExpressAuthMerchantScreen
214
+ },
215
+ {
216
+ name: 'CONNECT_EXPRESS_AUTH_ACCOUNT_CREATED_STEP',
217
+ element: ConnectExpressAuthAccountCreatedLoaderScreen
213
218
  }
214
219
  ];
215
220
  export var authFeatureScreens = [
@@ -2,6 +2,8 @@ import * as React from 'react';
2
2
  export interface DataLoadingProps {
3
3
  error?: string | null;
4
4
  children?: React.ReactNode;
5
+ title?: string;
6
+ hideSubtitle?: boolean;
5
7
  }
6
- declare const _default: React.MemoExoticComponent<({ error, children }: DataLoadingProps) => import("react/jsx-runtime").JSX.Element>;
8
+ declare const _default: React.MemoExoticComponent<({ error, children, title, hideSubtitle }: DataLoadingProps) => import("react/jsx-runtime").JSX.Element>;
7
9
  export default _default;
@@ -51,8 +51,8 @@ var SubTitleStyled = styled(Text)(function (_a) {
51
51
  return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center' }));
52
52
  });
53
53
  var DataLoading = function (_a) {
54
- var error = _a.error, children = _a.children;
54
+ var error = _a.error, children = _a.children, title = _a.title, hideSubtitle = _a.hideSubtitle;
55
55
  var t = useTranslation().t;
56
- return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(TitleContainerStyled, { children: [_jsx(Collapse, __assign({ in: !!error }, { children: _jsx(GenericError, { error: error || '', errorTitle: 'oops' }) })), _jsxs(Collapse, __assign({ in: !error }, { children: [_jsx(Container, { children: _jsx(LottieFile, { file: LottieAnimationFiles.account_creation, loop: true, height: '375px' }) }), _jsxs(_Fragment, { children: [_jsx(TitleStyled, { children: t('prepare_data_title') }), _jsx(SubTitleStyled, { children: t('prepare_data_description') })] })] }))] }), children] })));
56
+ return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(TitleContainerStyled, { children: [_jsx(Collapse, __assign({ in: !!error }, { children: _jsx(GenericError, { error: error || '', errorTitle: 'oops' }) })), _jsxs(Collapse, __assign({ in: !error }, { children: [_jsx(Container, { children: _jsx(LottieFile, { file: LottieAnimationFiles.account_creation, loop: true, height: '375px' }) }), _jsxs(_Fragment, { children: [_jsx(TitleStyled, { children: t(title || 'prepare_data_title') }), !hideSubtitle && _jsx(SubTitleStyled, { children: t('prepare_data_description') })] })] }))] }), children] })));
57
57
  };
58
58
  export default React.memo(DataLoading);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.6.92-test",
3
+ "version": "2.6.93-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",