@tap-payments/auth-jsconnect 1.0.84 → 1.0.85
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 +2 -0
- package/build/app/settings.d.ts +4 -1
- package/build/app/settings.js +13 -2
- package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
- package/build/components/AnimationFlow/AnimationFlow.js +3 -3
- package/build/components/AnimationFlow/BottomSheet.js +3 -0
- package/build/components/AnimationFlow/Dialog.d.ts +2 -1
- package/build/components/AnimationFlow/Dialog.js +6 -4
- package/build/constants/assets.d.ts +1 -0
- package/build/constants/assets.js +1 -0
- package/build/features/app/bank/bankStore.js +1 -1
- package/build/features/app/business/businessStore.js +2 -1
- package/build/features/app/individual/individualStore.js +1 -1
- package/build/features/app/password/passwordStore.js +1 -1
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/bank/Bank.js +8 -8
- package/build/features/bank/screens/BankDetails/validation.js +2 -2
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
- package/build/features/business/Business.js +8 -8
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -5
- package/build/features/connect/Connect.js +8 -8
- package/build/features/connect/screens/Individual/MobileNumber.js +10 -4
- package/build/features/connect/screens/Mobile/MobileNumber.js +10 -4
- package/build/features/individual/Individual.js +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +16 -5
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
- package/build/features/password/Password.js +8 -8
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -4
- package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +1 -1
- package/build/features/shared/Background/Background.d.ts +10 -0
- package/build/features/shared/Background/Background.js +29 -0
- package/build/features/shared/Background/LogoBackground.d.ts +6 -0
- package/build/features/shared/Background/LogoBackground.js +47 -0
- package/build/features/shared/Background/index.d.ts +2 -0
- package/build/features/shared/Background/index.js +2 -0
- package/build/features/shared/Button/Button.d.ts +1 -2
- package/build/features/shared/Button/SuccessButton.d.ts +3 -3
- package/build/features/shared/Button/SuccessButton.js +32 -37
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/tax/Tax.js +8 -8
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -5
- package/build/hooks/useAppConfig.js +12 -3
- package/build/theme/components.js +9 -0
- package/build/utils/array.d.ts +1 -0
- package/build/utils/array.js +7 -0
- package/build/utils/validation.d.ts +1 -0
- package/build/utils/validation.js +3 -0
- package/package.json +1 -1
package/build/@types/app.d.ts
CHANGED
package/build/app/settings.d.ts
CHANGED
|
@@ -19,10 +19,13 @@ export interface SettingsData {
|
|
|
19
19
|
deviceInfo: DeviceInfo;
|
|
20
20
|
appConfig: LibConfig;
|
|
21
21
|
open: boolean;
|
|
22
|
+
isTapOrigin: boolean;
|
|
22
23
|
}
|
|
23
24
|
export interface SettingsState extends SharedState<SettingsData> {
|
|
24
25
|
}
|
|
25
26
|
export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsState, {
|
|
27
|
+
handleIsTapOrigin: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
28
|
+
handleOpen: (state: import("immer/dist/internal").WritableDraft<SettingsState>, action: ActionState<boolean>) => void;
|
|
26
29
|
handleSkin: (state: SettingsState, action: ActionState<ThemeMode>) => void;
|
|
27
30
|
handleLanguage: (state: SettingsState, action: ActionState<LanguageMode>) => void;
|
|
28
31
|
handleNextScreenStep: (state: SettingsState, action: ActionState<string | undefined>) => void;
|
|
@@ -31,7 +34,7 @@ export declare const settingsSlice: import("@reduxjs/toolkit").Slice<SettingsSta
|
|
|
31
34
|
handleActiveFlowScreens: (state: SettingsState, action: ActionState<Array<ScreenStepNavigation>>) => void;
|
|
32
35
|
handleSetAppConfig: (state: SettingsState, action: ActionState<LibConfig>) => void;
|
|
33
36
|
}, "settings">;
|
|
34
|
-
export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>;
|
|
37
|
+
export declare const handleSkin: import("@reduxjs/toolkit").ActionCreatorWithPayload<ThemeMode, string>, handleLanguage: import("@reduxjs/toolkit").ActionCreatorWithPayload<LanguageMode, string>, handleActiveFlowScreens: import("@reduxjs/toolkit").ActionCreatorWithPayload<ScreenStepNavigation[], string>, handleNextScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handlePrevScreenStep: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, string>, handleCurrentActiveScreen: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, string>, handleSetAppConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<LibConfig, string>, handleOpen: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>, handleIsTapOrigin: import("@reduxjs/toolkit").ActionCreatorWithPayload<boolean, string>;
|
|
35
38
|
declare const _default: import("redux").Reducer<SettingsState, import("redux").AnyAction>;
|
|
36
39
|
export default _default;
|
|
37
40
|
export declare const settingsSelector: (state: RootState) => SettingsState;
|
package/build/app/settings.js
CHANGED
|
@@ -92,6 +92,7 @@ var initialState = {
|
|
|
92
92
|
loading: false,
|
|
93
93
|
data: {
|
|
94
94
|
open: true,
|
|
95
|
+
isTapOrigin: true,
|
|
95
96
|
skin: getStoredData(LOCAL_STORAGE_KEYS.themeMode) || 'light',
|
|
96
97
|
language: getStoredData(LOCAL_STORAGE_KEYS.languageMode) || 'en',
|
|
97
98
|
featureScreensNavigation: [],
|
|
@@ -104,6 +105,12 @@ export var settingsSlice = createSlice({
|
|
|
104
105
|
name: 'settings',
|
|
105
106
|
initialState: initialState,
|
|
106
107
|
reducers: {
|
|
108
|
+
handleIsTapOrigin: function (state, action) {
|
|
109
|
+
state.data.isTapOrigin = action.payload;
|
|
110
|
+
},
|
|
111
|
+
handleOpen: function (state, action) {
|
|
112
|
+
state.data.open = action.payload;
|
|
113
|
+
},
|
|
107
114
|
handleSkin: function (state, action) {
|
|
108
115
|
state.data.skin = action.payload;
|
|
109
116
|
storeData(LOCAL_STORAGE_KEYS.themeMode, action.payload);
|
|
@@ -158,7 +165,7 @@ export var settingsSlice = createSlice({
|
|
|
158
165
|
state.data.activeScreen = action.payload[0];
|
|
159
166
|
},
|
|
160
167
|
handleSetAppConfig: function (state, action) {
|
|
161
|
-
var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey;
|
|
168
|
+
var _a = action.payload, appInfo = _a.appInfo, businessCountryCode = _a.businessCountryCode, language = _a.language, onError = _a.onError, onFlowCompleted = _a.onFlowCompleted, publicKey = _a.publicKey, merchantDomain = _a.merchantDomain, open = _a.open;
|
|
162
169
|
if (!appInfo.name)
|
|
163
170
|
throw new Error('App name is required');
|
|
164
171
|
if (!businessCountryCode)
|
|
@@ -171,6 +178,10 @@ export var settingsSlice = createSlice({
|
|
|
171
178
|
throw new Error('On error function is required');
|
|
172
179
|
if (!onFlowCompleted)
|
|
173
180
|
throw new Error('On flow completed function is required');
|
|
181
|
+
if (!merchantDomain)
|
|
182
|
+
throw new Error('Merchant domain is required');
|
|
183
|
+
if (typeof open !== 'boolean')
|
|
184
|
+
throw new Error('Open is required');
|
|
174
185
|
state.data.appConfig = action.payload;
|
|
175
186
|
}
|
|
176
187
|
},
|
|
@@ -248,6 +259,6 @@ export var settingsSlice = createSlice({
|
|
|
248
259
|
});
|
|
249
260
|
}
|
|
250
261
|
});
|
|
251
|
-
export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig;
|
|
262
|
+
export var handleSkin = (_a = settingsSlice.actions, _a.handleSkin), handleLanguage = _a.handleLanguage, handleActiveFlowScreens = _a.handleActiveFlowScreens, handleNextScreenStep = _a.handleNextScreenStep, handlePrevScreenStep = _a.handlePrevScreenStep, handleCurrentActiveScreen = _a.handleCurrentActiveScreen, handleSetAppConfig = _a.handleSetAppConfig, handleOpen = _a.handleOpen, handleIsTapOrigin = _a.handleIsTapOrigin;
|
|
252
263
|
export default settingsSlice.reducer;
|
|
253
264
|
export var settingsSelector = function (state) { return state.settings; };
|
|
@@ -2,10 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
export interface AnimationFlowProps {
|
|
3
3
|
open: boolean;
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
+
isTapOrigin?: boolean;
|
|
5
6
|
footer?: React.ReactNode;
|
|
6
7
|
type?: 'PUPOP' | 'BOTTOMSHEET';
|
|
7
8
|
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
error?: string | null;
|
|
10
11
|
}
|
|
11
|
-
export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error }: AnimationFlowProps): JSX.Element;
|
|
12
|
+
export default function AnimationFlow({ open, children, breakpoint, type, footer, loading, error, isTapOrigin }: AnimationFlowProps): JSX.Element;
|
|
@@ -17,7 +17,7 @@ import BottomSheet from './BottomSheet';
|
|
|
17
17
|
import Loader from './Loader';
|
|
18
18
|
import Error from './Error';
|
|
19
19
|
export default function AnimationFlow(_a) {
|
|
20
|
-
var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error;
|
|
20
|
+
var open = _a.open, children = _a.children, breakpoint = _a.breakpoint, type = _a.type, footer = _a.footer, loading = _a.loading, error = _a.error, isTapOrigin = _a.isTapOrigin;
|
|
21
21
|
var theme = useTheme();
|
|
22
22
|
var matches = useMediaQuery(theme.breakpoints.down(breakpoint || 'sm'));
|
|
23
23
|
if (loading) {
|
|
@@ -27,10 +27,10 @@ export default function AnimationFlow(_a) {
|
|
|
27
27
|
return _jsx(Error, { error: error });
|
|
28
28
|
}
|
|
29
29
|
if (type === 'PUPOP') {
|
|
30
|
-
return (_jsx(Dialog, __assign({ footer: footer, open: open }, { children: children })));
|
|
30
|
+
return (_jsx(Dialog, __assign({ footer: footer, open: open, isTapOrigin: isTapOrigin }, { children: children })));
|
|
31
31
|
}
|
|
32
32
|
if (type === 'BOTTOMSHEET') {
|
|
33
33
|
return _jsx(BottomSheet, __assign({ open: open }, { children: children }));
|
|
34
34
|
}
|
|
35
|
-
return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer }, { children: children })));
|
|
35
|
+
return matches ? (_jsx(BottomSheet, __assign({ open: open }, { children: children }))) : (_jsx(Dialog, __assign({ open: open, footer: footer, isTapOrigin: isTapOrigin }, { children: children })));
|
|
36
36
|
}
|
|
@@ -2,9 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { DialogProps as MUIDialogProps } from '@mui/material/Dialog';
|
|
3
3
|
export interface DialogProps extends MUIDialogProps {
|
|
4
4
|
open: boolean;
|
|
5
|
+
isTapOrigin?: boolean;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
footer?: React.ReactNode;
|
|
7
8
|
transitionDuration?: number;
|
|
8
9
|
}
|
|
9
|
-
declare const _default: React.MemoExoticComponent<({ open, children, footer, transitionDuration, ...rest }: DialogProps) => JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ open, children, footer, transitionDuration, isTapOrigin, ...rest }: DialogProps) => JSX.Element>;
|
|
10
11
|
export default _default;
|
|
@@ -32,6 +32,7 @@ import { useLanguage } from '../../hooks';
|
|
|
32
32
|
import Slide from '../Slide';
|
|
33
33
|
import LogoBadge from '../LogoBadge';
|
|
34
34
|
import Icon from '../Icon';
|
|
35
|
+
import Collapse from '../Collapse';
|
|
35
36
|
var Transition = React.forwardRef(function Transition(props, ref) {
|
|
36
37
|
return _jsx(Slide, __assign({ direction: 'up', ref: ref }, props));
|
|
37
38
|
});
|
|
@@ -42,7 +43,7 @@ var PaperStyled = styled(Paper)(function (_a) {
|
|
|
42
43
|
borderRadius: theme.spacing(1.5),
|
|
43
44
|
backgroundColor: theme.palette.background.paper,
|
|
44
45
|
color: theme.palette.text.primary,
|
|
45
|
-
margin: "".concat(theme.spacing(5, 4,
|
|
46
|
+
margin: "".concat(theme.spacing(5, 4, 5, 4), " !important"),
|
|
46
47
|
maxHeight: "calc(100% - ".concat(theme.spacing(10), ") !important"),
|
|
47
48
|
width: theme.spacing(46.875),
|
|
48
49
|
maxWidth: theme.spacing(46.875)
|
|
@@ -52,6 +53,7 @@ var DialogContentStyled = styled(DialogContent)(function (_a) {
|
|
|
52
53
|
var theme = _a.theme;
|
|
53
54
|
return ({
|
|
54
55
|
padding: theme.spacing(0),
|
|
56
|
+
paddingTop: theme.spacing(3.75),
|
|
55
57
|
width: '100%',
|
|
56
58
|
'&::-webkit-scrollbar': {
|
|
57
59
|
width: '0px'
|
|
@@ -70,7 +72,7 @@ var LogoIconBoxStyled = styled(Box)(function (_a) {
|
|
|
70
72
|
var _b;
|
|
71
73
|
var theme = _a.theme;
|
|
72
74
|
return (_b = {
|
|
73
|
-
paddingTop: theme.spacing(
|
|
75
|
+
paddingTop: theme.spacing(3.125),
|
|
74
76
|
paddingBottom: theme.spacing(2.5),
|
|
75
77
|
width: '100%',
|
|
76
78
|
display: 'flex',
|
|
@@ -90,7 +92,7 @@ var LogoIconStyled = styled(Icon)(function (_a) {
|
|
|
90
92
|
});
|
|
91
93
|
});
|
|
92
94
|
var Dialog = function (_a) {
|
|
93
|
-
var open = _a.open, children = _a.children, footer = _a.footer, transitionDuration = _a.transitionDuration, rest = __rest(_a, ["open", "children", "footer", "transitionDuration"]);
|
|
95
|
+
var open = _a.open, children = _a.children, footer = _a.footer, transitionDuration = _a.transitionDuration, isTapOrigin = _a.isTapOrigin, rest = __rest(_a, ["open", "children", "footer", "transitionDuration", "isTapOrigin"]);
|
|
94
96
|
var isAr = useLanguage().isAr;
|
|
95
97
|
return (_jsxs(MuiDialog, __assign({ PaperProps: {
|
|
96
98
|
elevation: 0
|
|
@@ -98,6 +100,6 @@ var Dialog = function (_a) {
|
|
|
98
100
|
'& .MuiDialog-paper': {
|
|
99
101
|
overflowY: 'visible'
|
|
100
102
|
}
|
|
101
|
-
}, PaperComponent: PaperStyled, open: open, TransitionComponent: Transition, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, { children: [_jsxs(DialogContentStyled, { children: [_jsx(LogoBadge, { src: ICONS_NAMES.LOGO_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) }), children] }), footer] })));
|
|
103
|
+
}, hideBackdrop: true, PaperComponent: PaperStyled, open: open, TransitionComponent: Transition, transitionDuration: transitionDuration || 500, keepMounted: true, "aria-describedby": 'dialog-slide-description' }, rest, { children: [_jsxs(DialogContentStyled, { children: [_jsxs(Collapse, __assign({ in: !isTapOrigin }, { children: [_jsx(LogoBadge, { src: ICONS_NAMES.LOGO_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_AR : ICONS_NAMES.TAP_EN, alt: 'tap logo' }) })] })), children] }), footer] })));
|
|
102
104
|
};
|
|
103
105
|
export default React.memo(Dialog);
|
|
@@ -25,6 +25,7 @@ export var ICONS_NAMES = {
|
|
|
25
25
|
CR_ICON: ICONS_FULL_PATH + '/cr' + ICONS_EXTENSION,
|
|
26
26
|
CR_ACTIVE_ICON: ICONS_FULL_PATH + '/cr_active' + ICONS_EXTENSION,
|
|
27
27
|
INSTAGRAM_ACTIVE_ICON: ICONS_FULL_PATH + '/Insta-active' + ICONS_EXTENSION,
|
|
28
|
+
TAP_LOGO_EN_ICON: ICONS_FULL_PATH + '/tap-logo-white-en' + ICONS_EXTENSION,
|
|
28
29
|
TAP_EN: 'https://tap-connecet.b-cdn.net/imgs/tapEN' + ICONS_EXTENSION,
|
|
29
30
|
TAP_AR: 'https://tap-connecet.b-cdn.net/imgs/tapAR' + ICONS_EXTENSION,
|
|
30
31
|
ID_IMAGE: 'https://villageofwarwick.org/wp-content/uploads/2020/02/ICON99-512-1.png',
|
|
@@ -307,7 +307,7 @@ export var bankSlice = createSlice({
|
|
|
307
307
|
state.error = description;
|
|
308
308
|
return;
|
|
309
309
|
}
|
|
310
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody),
|
|
310
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
|
|
311
311
|
removeRequestHeaders();
|
|
312
312
|
})
|
|
313
313
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
@@ -658,6 +658,7 @@ export var businessSlice = createSlice({
|
|
|
658
658
|
if (!!selectedActivity)
|
|
659
659
|
state.data.activitiesData.activities = [selectedActivity];
|
|
660
660
|
state.data.businessTypeData.responseBody = __assign(__assign(__assign({}, data), state.data.businessTypeData.responseBody), { activities: activities });
|
|
661
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity });
|
|
661
662
|
})
|
|
662
663
|
.addCase(updateLeadBusinessType.rejected, function (state, action) {
|
|
663
664
|
state.loading = false;
|
|
@@ -770,7 +771,7 @@ export var businessSlice = createSlice({
|
|
|
770
771
|
state.error = description;
|
|
771
772
|
return;
|
|
772
773
|
}
|
|
773
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody),
|
|
774
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
|
|
774
775
|
removeRequestHeaders();
|
|
775
776
|
})
|
|
776
777
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
@@ -392,7 +392,7 @@ export var individualSlice = createSlice({
|
|
|
392
392
|
state.error = description;
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody),
|
|
395
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
|
|
396
396
|
removeRequestHeaders();
|
|
397
397
|
})
|
|
398
398
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
@@ -299,7 +299,7 @@ export var passwordSlice = createSlice({
|
|
|
299
299
|
state.error = description;
|
|
300
300
|
return;
|
|
301
301
|
}
|
|
302
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody),
|
|
302
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
|
|
303
303
|
removeRequestHeaders();
|
|
304
304
|
})
|
|
305
305
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
@@ -297,7 +297,7 @@ export var taxSlice = createSlice({
|
|
|
297
297
|
state.error = description;
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody),
|
|
300
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
|
|
301
301
|
removeRequestHeaders();
|
|
302
302
|
})
|
|
303
303
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect } from 'react';
|
|
14
14
|
import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '../../hooks';
|
|
15
15
|
import { settingsSelector } from '../../app/settings';
|
|
16
16
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
@@ -23,15 +23,15 @@ import { BANK_SCREENS_NAVIGATION } from '../../constants';
|
|
|
23
23
|
import { bankFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
26
|
+
import Background from '../shared/Background';
|
|
26
27
|
var Bank = memo(function (props) {
|
|
27
|
-
var open = React.useState(true)[0];
|
|
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
31
|
var customLoading = useAppSelector(bankSelector).customLoading;
|
|
32
32
|
var loading = useAppConfig(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props)).loading;
|
|
33
33
|
useErrorListener();
|
|
34
|
-
var activeScreen = data.activeScreen;
|
|
34
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
35
|
var verifyToken = function () {
|
|
36
36
|
var token = getParameterByName('token');
|
|
37
37
|
if (!token)
|
|
@@ -42,11 +42,11 @@ var Bank = memo(function (props) {
|
|
|
42
42
|
if (!loading)
|
|
43
43
|
verifyToken();
|
|
44
44
|
}, [loading]);
|
|
45
|
-
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: bankFeatureScreens.map(function (_a, index) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
46
|
+
var Element = _a.element, name = _a.name;
|
|
47
|
+
var isActive = activeScreen.name === name;
|
|
48
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
49
|
+
}) }) })) })) })));
|
|
50
50
|
});
|
|
51
51
|
export function BankLib(props) {
|
|
52
52
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Bank, __assign({}, props)) })));
|
|
@@ -3,8 +3,8 @@ import * as yup from 'yup';
|
|
|
3
3
|
export var BankValidation = yup.object().shape({
|
|
4
4
|
iban: yup
|
|
5
5
|
.string()
|
|
6
|
-
.matches(/^[a-zA-Z]{2}
|
|
7
|
-
.min(
|
|
6
|
+
.matches(/^[a-zA-Z]{2}[a-zA-Z0-9]{13,34}$/g, 'invalid_iban_format')
|
|
7
|
+
.min(15, 'invalid_iban_format')
|
|
8
8
|
.max(34, 'invalid_iban_format')
|
|
9
9
|
.required('alert_iban'),
|
|
10
10
|
bankName: yup.string().optional(),
|
|
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
|
|
|
16
16
|
import { FlowsButtons } from '../../../shared/Button';
|
|
17
17
|
import { ICONS_NAMES } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
-
import { showLastFour } from '../../../../utils';
|
|
19
|
+
import { allAreTruthy, showLastFour } from '../../../../utils';
|
|
20
20
|
import { bankSelector } from '../../../app/bank/bankStore';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -76,8 +76,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
76
76
|
setIsAcceptance(true);
|
|
77
77
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
78
78
|
var isIndividual = name === 'individual';
|
|
79
|
-
if (name !== 'password')
|
|
80
|
-
statuses.push(isCompleted);
|
|
81
79
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
82
80
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
83
81
|
return {
|
|
@@ -90,7 +88,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
90
88
|
};
|
|
91
89
|
});
|
|
92
90
|
setButtons(mappedFlows);
|
|
93
|
-
var isAllCompleted =
|
|
91
|
+
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
94
92
|
if (isAllCompleted)
|
|
95
93
|
setIsPayout(true);
|
|
96
94
|
};
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { 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';
|
|
@@ -23,15 +23,15 @@ import { getParameterByName, reactElement } from '../../utils';
|
|
|
23
23
|
import { BUSINESS_SCREENS_NAVIGATION } from '../../constants';
|
|
24
24
|
import { businessFeatureScreens } from '../featuresScreens';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
|
+
import Background from '../shared/Background';
|
|
26
27
|
var Business = memo(function (props) {
|
|
27
|
-
var open = React.useState(true)[0];
|
|
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
31
|
var customLoading = useAppSelector(businessSelector).customLoading;
|
|
32
32
|
var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
|
|
33
33
|
useErrorListener();
|
|
34
|
-
var activeScreen = data.activeScreen;
|
|
34
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
35
|
var verifyToken = function () {
|
|
36
36
|
var token = getParameterByName('token');
|
|
37
37
|
if (!token)
|
|
@@ -45,11 +45,11 @@ var Business = memo(function (props) {
|
|
|
45
45
|
useEffect(function () {
|
|
46
46
|
dispatch(getCountries());
|
|
47
47
|
}, []);
|
|
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) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
49
|
+
var Element = _a.element, name = _a.name;
|
|
50
|
+
var isActive = activeScreen.name === name;
|
|
51
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
52
|
+
}) }) })) })) })));
|
|
53
53
|
});
|
|
54
54
|
export function BusinessLib(props) {
|
|
55
55
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Business, __assign({}, props)) })));
|
|
@@ -17,7 +17,7 @@ import { FlowsButtons } from '../../../shared/Button';
|
|
|
17
17
|
import { ICONS_NAMES } from '../../../../constants';
|
|
18
18
|
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
19
|
import { businessSelector } from '../../../app/business/businessStore';
|
|
20
|
-
import { showLastFour } from '../../../../utils';
|
|
20
|
+
import { allAreTruthy, showLastFour } from '../../../../utils';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
23
23
|
import Container from '../../../shared/Containers/ScreenContainer';
|
|
@@ -60,7 +60,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
60
60
|
var reMapFlowData = function (flows) {
|
|
61
61
|
if (flows === void 0) { flows = []; }
|
|
62
62
|
var images = ICONS_NAMES;
|
|
63
|
-
var statuses = [];
|
|
64
63
|
var mappedFlows = flows.map(function (_a) {
|
|
65
64
|
var name = _a.name, url = _a.url, status = _a.status;
|
|
66
65
|
var type = status === 'initiated' ? 'pending' : 'completed';
|
|
@@ -76,8 +75,6 @@ var SuccessWithFlowButtons = function () {
|
|
|
76
75
|
setIsAcceptance(true);
|
|
77
76
|
var isCompleted = status === 'completed' && name !== 'password';
|
|
78
77
|
var isIndividual = name === 'individual';
|
|
79
|
-
if (name !== 'password')
|
|
80
|
-
statuses.push(isCompleted);
|
|
81
78
|
var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
|
|
82
79
|
var hoverSrc = "".concat(name, "_white_icon");
|
|
83
80
|
return {
|
|
@@ -90,7 +87,7 @@ var SuccessWithFlowButtons = function () {
|
|
|
90
87
|
};
|
|
91
88
|
});
|
|
92
89
|
setButtons(mappedFlows);
|
|
93
|
-
var isAllCompleted =
|
|
90
|
+
var isAllCompleted = allAreTruthy(flows, 'completed', 'status', 'password');
|
|
94
91
|
if (isAllCompleted)
|
|
95
92
|
setIsPayout(true);
|
|
96
93
|
};
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect } from 'react';
|
|
14
14
|
import { FeatureContainer } from '../shared/Containers';
|
|
15
15
|
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
|
|
16
16
|
import { settingsSelector } from '../../app/settings';
|
|
@@ -23,22 +23,22 @@ import { reactElement } from '../../utils';
|
|
|
23
23
|
import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
|
|
24
24
|
import { connectFeatureScreens } from '../featuresScreens';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
|
+
import Background from '../shared/Background';
|
|
26
27
|
var Connect = memo(function (props) {
|
|
27
|
-
var open = React.useState(true)[0];
|
|
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
31
|
useAppConfig(__assign({ navigation: CONNECT_SCREENS_NAVIGATION }, props));
|
|
32
32
|
useErrorListener();
|
|
33
|
-
var activeScreen = data.activeScreen;
|
|
33
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
34
34
|
useEffect(function () {
|
|
35
35
|
dispatch(getCountries());
|
|
36
36
|
}, []);
|
|
37
|
-
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: connectFeatureScreens.map(function (_a, index) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
38
|
+
var Element = _a.element, name = _a.name;
|
|
39
|
+
var isActive = activeScreen.name === name;
|
|
40
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
41
|
+
}) }) })) })) })));
|
|
42
42
|
});
|
|
43
43
|
export function ConnectLib(props) {
|
|
44
44
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Connect, __assign({}, props)) })));
|
|
@@ -113,14 +113,18 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
113
113
|
};
|
|
114
114
|
var onCloseCountryList = function () {
|
|
115
115
|
var _a;
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
if (anchorEl) {
|
|
117
|
+
setAnchorEl(null);
|
|
118
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
119
|
+
}
|
|
120
|
+
setCountries(countries);
|
|
118
121
|
};
|
|
119
122
|
var toggleCountryList = function () {
|
|
120
123
|
var _a, _b;
|
|
121
124
|
if (anchorEl) {
|
|
122
125
|
setAnchorEl(null);
|
|
123
126
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
127
|
+
setCountries(countries);
|
|
124
128
|
}
|
|
125
129
|
else {
|
|
126
130
|
(_b = rest.onListOpen) === null || _b === void 0 ? void 0 : _b.call(rest);
|
|
@@ -134,12 +138,14 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
134
138
|
};
|
|
135
139
|
var handleSearch = function (value) {
|
|
136
140
|
var filteredCountries = countries.filter(function (country) {
|
|
137
|
-
return country.
|
|
141
|
+
return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
|
|
142
|
+
country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
143
|
+
country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
138
144
|
country.name.english.toLowerCase().startsWith(value.toLowerCase());
|
|
139
145
|
});
|
|
140
146
|
setCountries(filteredCountries);
|
|
141
147
|
};
|
|
142
|
-
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(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: !!anchorEl, 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, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
148
|
+
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(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: !!anchorEl, onClick: onCloseCountryList, 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, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
143
149
|
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, {})] }));
|
|
144
150
|
} })] }))] })) })));
|
|
145
151
|
});
|
|
@@ -115,14 +115,18 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
115
115
|
};
|
|
116
116
|
var onCloseCountryList = function () {
|
|
117
117
|
var _a;
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
if (anchorEl) {
|
|
119
|
+
setAnchorEl(null);
|
|
120
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
121
|
+
}
|
|
122
|
+
setCountries(countries);
|
|
120
123
|
};
|
|
121
124
|
var toggleCountryList = function () {
|
|
122
125
|
var _a, _b;
|
|
123
126
|
if (anchorEl) {
|
|
124
127
|
setAnchorEl(null);
|
|
125
128
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
129
|
+
setCountries(countries);
|
|
126
130
|
}
|
|
127
131
|
else {
|
|
128
132
|
(_b = rest.onListOpen) === null || _b === void 0 ? void 0 : _b.call(rest);
|
|
@@ -136,12 +140,14 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
|
|
|
136
140
|
};
|
|
137
141
|
var handleSearch = function (value) {
|
|
138
142
|
var filteredCountries = countries.filter(function (country) {
|
|
139
|
-
return country.
|
|
143
|
+
return country.idd_prefix.toString().toLowerCase().startsWith(value.replace('+', '').toLowerCase()) ||
|
|
144
|
+
country.capital.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
145
|
+
country.name.arabic.toLowerCase().startsWith(value.toLowerCase()) ||
|
|
140
146
|
country.name.english.toLowerCase().startsWith(value.toLowerCase());
|
|
141
147
|
});
|
|
142
148
|
setCountries(filteredCountries);
|
|
143
149
|
};
|
|
144
|
-
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(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', readOnly: !!anchorEl, 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, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
150
|
+
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(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', readOnly: !!anchorEl, required: true, onClick: onCloseCountryList, 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, { searchKeyPath: 'name.english', list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
145
151
|
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, {})] }));
|
|
146
152
|
} })] }))] })) })));
|
|
147
153
|
});
|
|
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import { memo, useEffect } from 'react';
|
|
14
14
|
import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
|
|
15
15
|
import { settingsSelector } from '../../app/settings';
|
|
16
16
|
import AnimationFlow from '../../components/AnimationFlow';
|
|
@@ -23,15 +23,15 @@ import { INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
|
|
|
23
23
|
import { individualFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import { getCountries, individualSelector, verifyLeadToken } from '../app/individual/individualStore';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
|
+
import Background from '../shared/Background';
|
|
26
27
|
var Individual = memo(function (props) {
|
|
27
|
-
var open = React.useState(true)[0];
|
|
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
31
|
var customLoading = useAppSelector(individualSelector).customLoading;
|
|
32
32
|
var loading = useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props)).loading;
|
|
33
33
|
useErrorListener();
|
|
34
|
-
var activeScreen = data.activeScreen;
|
|
34
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
35
|
var verifyToken = function () {
|
|
36
36
|
var token = getParameterByName('token');
|
|
37
37
|
if (!token)
|
|
@@ -45,11 +45,11 @@ var Individual = memo(function (props) {
|
|
|
45
45
|
useEffect(function () {
|
|
46
46
|
dispatch(getCountries());
|
|
47
47
|
}, []);
|
|
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: individualFeatureScreens.map(function (_a, index) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
49
|
+
var Element = _a.element, name = _a.name;
|
|
50
|
+
var isActive = activeScreen.name === name;
|
|
51
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
52
|
+
}) }) })) })) })));
|
|
53
53
|
});
|
|
54
54
|
export function IndividualLib(props) {
|
|
55
55
|
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Individual, __assign({}, props)) })));
|