@tap-payments/auth-jsconnect 2.10.7-beta → 2.10.7-development
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 +9 -2
- package/build/@types/app.js +8 -0
- package/build/@types/form.d.ts +3 -0
- package/build/@types/index.d.ts +1 -0
- package/build/@types/index.js +1 -0
- package/build/@types/terminal.d.ts +116 -0
- package/build/@types/terminal.js +1 -0
- package/build/api/auth.d.ts +10 -1
- package/build/api/index.d.ts +7 -1
- package/build/api/index.js +3 -1
- package/build/api/terminal.d.ts +28 -0
- package/build/api/terminal.js +45 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/settings.d.ts +1 -0
- package/build/app/settings.js +7 -3
- package/build/app/store.d.ts +2 -0
- package/build/assets/currencies/SARSymbol.d.ts +7 -0
- package/build/assets/currencies/SARSymbol.js +28 -0
- package/build/assets/currencies/index.d.ts +2 -0
- package/build/assets/currencies/index.js +2 -0
- package/build/assets/currencies/utils.d.ts +4 -0
- package/build/assets/currencies/utils.js +4 -0
- package/build/assets/locales/ar.json +43 -6
- package/build/assets/locales/en.json +46 -9
- package/build/components/DeviceCard/DeviceCard.d.ts +18 -0
- package/build/components/DeviceCard/DeviceCard.js +103 -0
- package/build/components/DeviceCard/index.d.ts +3 -0
- package/build/components/DeviceCard/index.js +2 -0
- package/build/components/OTPTimer/OTPTimer.d.ts +2 -1
- package/build/components/OTPTimer/OTPTimer.js +4 -4
- package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
- package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
- package/build/components/TextWithCurrency/index.d.ts +2 -0
- package/build/components/TextWithCurrency/index.js +2 -0
- package/build/components/Tooltip/Tooltip.js +1 -1
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +15 -3
- package/build/constants/app.js +158 -14
- package/build/constants/assets.d.ts +11 -0
- package/build/constants/assets.js +17 -3
- package/build/constants/flows.d.ts +15 -0
- package/build/constants/flows.js +15 -0
- package/build/constants/validation.d.ts +1 -0
- package/build/constants/validation.js +1 -0
- package/build/features/app/auth/authStore.d.ts +24 -5
- package/build/features/app/auth/authStore.js +136 -71
- package/build/features/app/connectExpress/connectExpressStore.d.ts +14 -3
- package/build/features/app/connectExpress/connectExpressStore.js +193 -49
- package/build/features/app/individual/individualStore.js +0 -1
- package/build/features/app/tax/taxStore.js +1 -1
- package/build/features/app/terminal/terminalStore.d.ts +109 -0
- package/build/features/app/terminal/terminalStore.js +676 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +13 -2
- package/build/features/auth/screens/OTP/OTP.js +15 -3
- package/build/features/auth/screens/OTP/index.d.ts +1 -2
- package/build/features/auth/screens/Passcode/Passcode.d.ts +16 -0
- package/build/features/auth/screens/Passcode/Passcode.js +82 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.d.ts +6 -0
- package/build/features/auth/screens/Passcode/PasscodeInput.js +42 -0
- package/build/features/auth/screens/Passcode/index.d.ts +2 -0
- package/build/features/auth/screens/Passcode/index.js +2 -0
- package/build/features/auth/screens/Passcode/validation.d.ts +8 -0
- package/build/features/auth/screens/Passcode/validation.js +4 -0
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -8
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -8
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/OTPInput.js +49 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.js +88 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.d.ts +8 -0
- package/build/features/connectExpress/screens/VerifyMobileAuthOTP/validation.js +4 -0
- package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +9 -3
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +3 -7
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +3 -7
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +77 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +3 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
- package/build/features/shared/Background/LogoBackground.js +5 -17
- package/build/features/shared/Button/Button.js +2 -3
- package/build/features/shared/Button/FlowsButtons.js +3 -2
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/PushNotification/PushNotification.d.ts +11 -0
- package/build/features/shared/PushNotification/PushNotification.js +34 -0
- package/build/features/shared/PushNotification/index.d.ts +2 -0
- package/build/features/shared/PushNotification/index.js +2 -0
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +3 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +2 -2
- package/build/features/terminal/Terminal.d.ts +14 -0
- package/build/features/terminal/Terminal.js +95 -0
- package/build/features/terminal/index.d.ts +1 -0
- package/build/features/terminal/index.js +1 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.d.ts +3 -0
- package/build/features/terminal/screens/LinkNewTerminal/LinkNewTerminal.js +68 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/index.js +2 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.d.ts +10 -0
- package/build/features/terminal/screens/LinkNewTerminal/styles.js +28 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/LinkedSuccess/LinkedSuccess.js +51 -0
- package/build/features/terminal/screens/LinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/LinkedTerminalInfo.js +50 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/LinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/Loading/Loading.d.ts +4 -0
- package/build/features/terminal/screens/Loading/Loading.js +10 -0
- package/build/features/terminal/screens/Loading/index.d.ts +2 -0
- package/build/features/terminal/screens/Loading/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.d.ts +3 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/NoTerminalDeviceLinked.js +56 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.d.ts +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/index.js +2 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.d.ts +36 -0
- package/build/features/terminal/screens/NoTerminalDeviceLinked/styles.js +34 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/terminal/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/terminal/screens/OperatorError/index.d.ts +2 -0
- package/build/features/terminal/screens/OperatorError/index.js +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +3 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +21 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/ResetPasswordSuccess/index.js +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +31 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.d.ts +2 -0
- package/build/features/terminal/screens/SuccessWithFlowButtons/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/DeviceList.js +20 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.d.ts +3 -0
- package/build/features/terminal/screens/TerminalDeviceList/TerminalDeviceList.js +144 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/index.js +2 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.d.ts +9 -0
- package/build/features/terminal/screens/TerminalDeviceList/styles.js +13 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.d.ts +3 -0
- package/build/features/terminal/screens/TerminalListPage/TerminalListPage.js +42 -0
- package/build/features/terminal/screens/TerminalListPage/index.d.ts +2 -0
- package/build/features/terminal/screens/TerminalListPage/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedSuccess/UnlinkedSuccess.js +53 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedSuccess/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.d.ts +3 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/UnlinkedTerminalInfo.js +98 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.d.ts +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/index.js +2 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.d.ts +26 -0
- package/build/features/terminal/screens/UnlinkedTerminalInfo/styles.js +30 -0
- package/build/features/terminal/screens/Verify/OTPInput.d.ts +7 -0
- package/build/features/terminal/screens/Verify/OTPInput.js +51 -0
- package/build/features/terminal/screens/Verify/Verify.d.ts +5 -0
- package/build/features/terminal/screens/Verify/Verify.js +85 -0
- package/build/features/terminal/screens/Verify/index.d.ts +2 -0
- package/build/features/terminal/screens/Verify/index.js +2 -0
- package/build/features/terminal/screens/Verify/validation.d.ts +8 -0
- package/build/features/terminal/screens/Verify/validation.js +4 -0
- package/build/features/terminal/screens/shared/Header.d.ts +10 -0
- package/build/features/terminal/screens/shared/Header.js +30 -0
- package/build/features/terminal/screens/shared/TerminalList.d.ts +11 -0
- package/build/features/terminal/screens/shared/TerminalList.js +25 -0
- package/build/features/terminal/screens/shared/index.d.ts +5 -0
- package/build/features/terminal/screens/shared/index.js +5 -0
- package/build/features/terminal/screens/shared/styles.d.ts +196 -0
- package/build/features/terminal/screens/shared/styles.js +155 -0
- package/build/features/terminal/screens/shared/utils.d.ts +7 -0
- package/build/features/terminal/screens/shared/utils.js +24 -0
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +4 -2
- package/build/theme/palette.js +12 -0
- package/build/theme/typography.js +4 -0
- package/build/utils/common.js +4 -4
- package/build/utils/string.d.ts +2 -2
- package/build/utils/string.js +4 -1
- package/package.json +3 -4
|
@@ -13,13 +13,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import * as React from 'react';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
|
-
import { formatNumberAsCurrency,
|
|
16
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
17
17
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
19
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
20
20
|
import Input from '../../../shared/Input';
|
|
21
21
|
import { clearError } from '../../../app/entity/entityStore';
|
|
22
22
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
23
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
23
24
|
var CapitalShareValue = function (_a) {
|
|
24
25
|
var _b;
|
|
25
26
|
var readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
@@ -34,14 +35,9 @@ var CapitalShareValue = function (_a) {
|
|
|
34
35
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
35
36
|
capitalShareValueControl.field.onChange(value);
|
|
36
37
|
};
|
|
37
|
-
var getCurrency = React.useMemo(function () {
|
|
38
|
-
return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
|
|
39
|
-
}, [settingsData.businessCountry.iso2]);
|
|
40
38
|
var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
|
|
41
39
|
var capitalShareValueValue = capitalShareValueControl.field.value;
|
|
42
40
|
var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
43
|
-
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
44
|
-
currency: getCurrency
|
|
45
|
-
}), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
41
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('capital_share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
|
|
46
42
|
};
|
|
47
43
|
export default React.memo(CapitalShareValue);
|
|
@@ -12,3 +12,4 @@ export declare const entityFeatureScreens: Array<FeatureScreenStep>;
|
|
|
12
12
|
export declare const brandFeatureScreens: Array<FeatureScreenStep>;
|
|
13
13
|
export declare const boardFeatureScreens: Array<FeatureScreenStep>;
|
|
14
14
|
export declare const kycFeatureScreens: Array<FeatureScreenStep>;
|
|
15
|
+
export declare const terminalFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -27,6 +27,7 @@ import ConnectExpressIdentityVerifyNafathScreen from './connectExpress/screens/I
|
|
|
27
27
|
import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
|
|
28
28
|
import ConnectExpressCollectDobScreen from './connectExpress/screens/DOB';
|
|
29
29
|
import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
|
|
30
|
+
import ConnectExpressVerifyAuthMobileOtpScreen from './connectExpress/screens/VerifyMobileAuthOTP';
|
|
30
31
|
import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
|
|
31
32
|
import ConnectExpressPreparingDataLoaderScreen from './connectExpress/screens/PrepareDataLoading';
|
|
32
33
|
import ConnectExpressSuccessFlowButtonsScreen from './connectExpress/screens/SuccessWithFlowButtons';
|
|
@@ -56,6 +57,7 @@ import AuthAccountCreatedLoaderScreen from './auth/screens/AccountCreatedLoader'
|
|
|
56
57
|
import AuthEmailSentScreen from './auth/screens/EmailSent';
|
|
57
58
|
import AuthMigratingDataScreen from './auth/screens/MigratingData';
|
|
58
59
|
import AuthOperatorError from './auth/screens/OperatorError';
|
|
60
|
+
import AuthPasscodeScreen from './auth/screens/Passcode';
|
|
59
61
|
import CustomersPage from './business/screens/Customers';
|
|
60
62
|
import IDBODPage from './business/screens/IDBOD';
|
|
61
63
|
import BusinessVerifyPage from './business/screens/Verify';
|
|
@@ -139,6 +141,19 @@ import KycOperatorErrorPage from './kyc/screens/OperatorError';
|
|
|
139
141
|
import KycSuccessPage from './kyc/screens/Success';
|
|
140
142
|
import KycTermsPage from './kyc/screens/Terms';
|
|
141
143
|
import KycUsersPage from './kyc/screens/Users';
|
|
144
|
+
import TerminalLoadingPage from './terminal/screens/Loading';
|
|
145
|
+
import TerminalOperatorErrorPage from './terminal/screens/OperatorError';
|
|
146
|
+
import TerminalVerifyPage from './terminal/screens/Verify';
|
|
147
|
+
import NoTerminalDeviceLinkedPage from './terminal/screens/NoTerminalDeviceLinked';
|
|
148
|
+
import TerminalDeviceListPage from './terminal/screens/TerminalDeviceList';
|
|
149
|
+
import TerminalListPage from './terminal/screens/TerminalListPage';
|
|
150
|
+
import LinkNewTerminalPage from './terminal/screens/LinkNewTerminal';
|
|
151
|
+
import LinkedTerminalInfoPage from './terminal/screens/LinkedTerminalInfo';
|
|
152
|
+
import UnlinkedTerminalInfoPage from './terminal/screens/UnlinkedTerminalInfo';
|
|
153
|
+
import LinkedSuccessPage from './terminal/screens/LinkedSuccess';
|
|
154
|
+
import UnlinkedSuccessPage from './terminal/screens/UnlinkedSuccess';
|
|
155
|
+
import TerminalBoardPage from './terminal/screens/SuccessWithFlowButtons';
|
|
156
|
+
import TerminalResetPasswordSuccessPage from './terminal/screens/ResetPasswordSuccess';
|
|
142
157
|
export var connectFeatureScreens = [
|
|
143
158
|
{
|
|
144
159
|
name: 'CONNECT_BUSINESS_COUNTRY_STEP',
|
|
@@ -262,6 +277,10 @@ export var connectExpressFeatureScreens = [
|
|
|
262
277
|
name: 'CONNECT_EXPRESS_COLLECT_BUSINESS_INFO_STEP',
|
|
263
278
|
element: ConnectExpressCollectBusinessScreen
|
|
264
279
|
},
|
|
280
|
+
{
|
|
281
|
+
name: 'CONNECT_EXPRESS_VERIFY_AUTH_OTP_STEP',
|
|
282
|
+
element: ConnectExpressVerifyAuthMobileOtpScreen
|
|
283
|
+
},
|
|
265
284
|
{
|
|
266
285
|
name: 'CONNECT_EXPRESS_ACCOUNT_ALREADY_CREATED_STEP',
|
|
267
286
|
element: ConnectExpressAccountAlreadyCreatedScreen
|
|
@@ -320,6 +339,10 @@ export var authFeatureScreens = [
|
|
|
320
339
|
name: 'AUTH_OTP_STEP',
|
|
321
340
|
element: AuthOTPScreen
|
|
322
341
|
},
|
|
342
|
+
{
|
|
343
|
+
name: 'AUTH_PASSCODE_STEP',
|
|
344
|
+
element: AuthPasscodeScreen
|
|
345
|
+
},
|
|
323
346
|
{
|
|
324
347
|
name: 'AUTH_PASSWORD_STEP',
|
|
325
348
|
element: AuthPasswordScreen
|
|
@@ -695,3 +718,57 @@ export var kycFeatureScreens = [
|
|
|
695
718
|
element: KycSuccessPage
|
|
696
719
|
}
|
|
697
720
|
];
|
|
721
|
+
export var terminalFeatureScreens = [
|
|
722
|
+
{
|
|
723
|
+
name: CONNECT_FLOWS.terminal.loadingData,
|
|
724
|
+
element: TerminalLoadingPage
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
name: CONNECT_FLOWS.terminal.operatorError,
|
|
728
|
+
element: TerminalOperatorErrorPage
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: CONNECT_FLOWS.terminal.verify,
|
|
732
|
+
element: TerminalVerifyPage
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: CONNECT_FLOWS.terminal.noTerminalLinked,
|
|
736
|
+
element: NoTerminalDeviceLinkedPage
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
name: CONNECT_FLOWS.terminal.terminalDeviceList,
|
|
740
|
+
element: TerminalDeviceListPage
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: CONNECT_FLOWS.terminal.terminalLinkNew,
|
|
744
|
+
element: LinkNewTerminalPage
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
name: CONNECT_FLOWS.terminal.terminalList,
|
|
748
|
+
element: TerminalListPage
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: CONNECT_FLOWS.terminal.linkedTerminalInfo,
|
|
752
|
+
element: LinkedTerminalInfoPage
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: CONNECT_FLOWS.terminal.unlinkedTerminalInfo,
|
|
756
|
+
element: UnlinkedTerminalInfoPage
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: CONNECT_FLOWS.terminal.terminalLinkedSuccess,
|
|
760
|
+
element: LinkedSuccessPage
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
name: CONNECT_FLOWS.terminal.terminalUnlinkedSuccess,
|
|
764
|
+
element: UnlinkedSuccessPage
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: CONNECT_FLOWS.terminal.board,
|
|
768
|
+
element: TerminalBoardPage
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
name: CONNECT_FLOWS.terminal.resetPassword,
|
|
772
|
+
element: TerminalResetPasswordSuccessPage
|
|
773
|
+
}
|
|
774
|
+
];
|
|
@@ -16,7 +16,7 @@ import { useController, useFormContext } from 'react-hook-form';
|
|
|
16
16
|
import Box from '@mui/material/Box';
|
|
17
17
|
import { styled } from '@mui/material/styles';
|
|
18
18
|
import { settingsSelector } from '../../../../app/settings';
|
|
19
|
-
import {
|
|
19
|
+
import { hasVerifiedValue } from '../../../../utils';
|
|
20
20
|
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
22
|
import Text from '../../../../components/Text';
|
|
@@ -26,6 +26,7 @@ import InputSelect from '../../../shared/InputSelect';
|
|
|
26
26
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
27
27
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
28
28
|
import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
|
|
29
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
29
30
|
var Container = styled(Box)(function () { return ({
|
|
30
31
|
display: 'flex'
|
|
31
32
|
}); });
|
|
@@ -45,16 +46,12 @@ var MonthlyIncome = function (props) {
|
|
|
45
46
|
var settingsData = useAppSelector(settingsSelector).data;
|
|
46
47
|
var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
|
|
47
48
|
var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
|
|
48
|
-
var countryCode = settingsData.businessCountry;
|
|
49
49
|
var user = (data.verify.responseBody || {}).user;
|
|
50
50
|
var isMonthlyIncomeVerified = function (item) {
|
|
51
51
|
if (!(item === null || item === void 0 ? void 0 : item.id))
|
|
52
52
|
return false;
|
|
53
53
|
return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
|
|
54
54
|
};
|
|
55
|
-
var getCurrency = React.useMemo(function () {
|
|
56
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
57
|
-
}, [countryCode.iso2]);
|
|
58
55
|
React.useEffect(function () {
|
|
59
56
|
if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
|
|
60
57
|
setIncomeList(monthlyIncomeList);
|
|
@@ -83,9 +80,7 @@ var MonthlyIncome = function (props) {
|
|
|
83
80
|
};
|
|
84
81
|
var income = monthlyIncomeControl.field.value;
|
|
85
82
|
var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: t('
|
|
87
|
-
currency: getCurrency
|
|
88
|
-
}), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputSelect, { label: _jsx(TextWithCurrency, { text: t('monthly_income'), countryCode: settingsData.businessCountry.iso2 }), required: true, readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error), endAdornment: _jsx(EndAdornmentExpanded, { isVerified: isMonthlyIncomeVerified(income), anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
89
84
|
return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
|
|
90
85
|
} }) }))] })) })));
|
|
91
86
|
};
|
|
@@ -14,13 +14,14 @@ import * as React from 'react';
|
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useController, useFormContext } from 'react-hook-form';
|
|
16
16
|
import Collapse from '@mui/material/Collapse';
|
|
17
|
-
import { formatNumberAsCurrency,
|
|
17
|
+
import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
|
|
18
18
|
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
19
19
|
import { settingsSelector } from '../../../../app/settings';
|
|
20
20
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
21
21
|
import Input from '../../../shared/Input';
|
|
22
22
|
import { individualSelector, clearError } from '../../../app/individual/individualStore';
|
|
23
23
|
import { EndAdornment } from '../../../shared/EndAdornment';
|
|
24
|
+
import TextWithCurrency from '../../../../components/TextWithCurrency';
|
|
24
25
|
var ShareValue = function (_a) {
|
|
25
26
|
var _b;
|
|
26
27
|
var show = _a.show, readOnly = _a.readOnly;
|
|
@@ -29,7 +30,6 @@ var ShareValue = function (_a) {
|
|
|
29
30
|
var control = useFormContext().control;
|
|
30
31
|
var bckError = useAppSelector(individualSelector).error;
|
|
31
32
|
var dispatch = useAppDispatch();
|
|
32
|
-
var countryCode = settingsData.businessCountry;
|
|
33
33
|
var handleChange = function (_a) {
|
|
34
34
|
var target = _a.target;
|
|
35
35
|
if (bckError)
|
|
@@ -37,14 +37,9 @@ var ShareValue = function (_a) {
|
|
|
37
37
|
var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
|
|
38
38
|
shareValueControl.field.onChange(value);
|
|
39
39
|
};
|
|
40
|
-
var getCurrency = React.useMemo(function () {
|
|
41
|
-
return t(getCurrencyByCountryIso2(countryCode.iso2));
|
|
42
|
-
}, [countryCode.iso2]);
|
|
43
40
|
var shareValueControl = useController({ control: control, name: 'shareValue' });
|
|
44
41
|
var shareValue = shareValueControl.field.value;
|
|
45
42
|
var error = (_b = shareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
46
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('
|
|
47
|
-
currency: getCurrency
|
|
48
|
-
}), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
|
|
43
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: _jsx(TextWithCurrency, { text: t('share_value_input_label'), countryCode: settingsData.businessCountry.iso2 }), onChange: handleChange, value: shareValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: shareValue, error: error }) }) })) })));
|
|
49
44
|
};
|
|
50
45
|
export default React.memo(ShareValue);
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from 'react';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import Box from '@mui/material/Box';
|
|
5
5
|
import Icon from '../../../components/Icon';
|
|
6
6
|
import { ICONS_NAMES } from '../../../constants';
|
|
7
|
-
import { useLanguage } from '../../../hooks';
|
|
8
7
|
var BoxStyled = styled(Box)(function (_a) {
|
|
9
8
|
var _b;
|
|
10
9
|
var theme = _a.theme;
|
|
11
10
|
return (_b = {
|
|
12
11
|
display: 'flex',
|
|
13
|
-
flexDirection: 'column',
|
|
14
12
|
justifyContent: 'center',
|
|
15
|
-
|
|
16
|
-
paddingTop: theme.spacing(5)
|
|
13
|
+
paddingTop: theme.spacing(10)
|
|
17
14
|
},
|
|
18
15
|
_b[theme.breakpoints.down('sm')] = {
|
|
19
16
|
paddingTop: theme.spacing(11)
|
|
@@ -23,20 +20,11 @@ var BoxStyled = styled(Box)(function (_a) {
|
|
|
23
20
|
var LogoBadgeStyled = styled(Icon)(function (_a) {
|
|
24
21
|
var theme = _a.theme;
|
|
25
22
|
return ({
|
|
26
|
-
height: theme.spacing(
|
|
27
|
-
width: theme.spacing(
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
var LogoIconStyled = styled(Icon)(function (_a) {
|
|
31
|
-
var theme = _a.theme;
|
|
32
|
-
return ({
|
|
33
|
-
width: theme.spacing(5.875),
|
|
34
|
-
height: theme.spacing(3.625),
|
|
35
|
-
marginTop: theme.spacing(2.5)
|
|
23
|
+
height: theme.spacing(9.5),
|
|
24
|
+
width: theme.spacing(19.322)
|
|
36
25
|
});
|
|
37
26
|
});
|
|
38
27
|
var LogoBackground = function () {
|
|
39
|
-
|
|
40
|
-
return (_jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' })] }));
|
|
28
|
+
return (_jsx(BoxStyled, { children: _jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO, alt: 'tap logo' }) }));
|
|
41
29
|
};
|
|
42
30
|
export default memo(LogoBackground);
|
|
@@ -53,8 +53,7 @@ var BackIconStyled = styled(Icon, { shouldForwardProp: function (prop) { return
|
|
|
53
53
|
var ButtonBoxStyled = styled(Box)(function (_a) {
|
|
54
54
|
var theme = _a.theme;
|
|
55
55
|
return ({
|
|
56
|
-
margin: theme.spacing(
|
|
57
|
-
marginBlockStart: theme.spacing(5),
|
|
56
|
+
margin: theme.spacing(5, 2.5, 2.5, 2.5),
|
|
58
57
|
maxHeight: theme.spacing(5.375),
|
|
59
58
|
display: 'flex',
|
|
60
59
|
alignItems: 'center',
|
|
@@ -113,5 +112,5 @@ export default function CustomButton(_a) {
|
|
|
113
112
|
}, 500);
|
|
114
113
|
};
|
|
115
114
|
}, []);
|
|
116
|
-
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, __assign({ sx: sx }, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); }
|
|
115
|
+
return (_jsxs(Fragment, { children: [_jsx(Collapse, __assign({ in: !!error && !hideError }, { children: _jsx(Warning, __assign({ sx: { mb: 1 }, warningType: 'error' }, { children: error })) })), _jsxs(ButtonBoxStyled, __assign({ sx: sx }, { children: [isBackEnabled && (_jsx(BackButtonStyled, __assign({ isAr: isAr, type: 'reset', startIcon: _jsx(BackIconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, props, { onClick: function () { return onBackClicked === null || onBackClicked === void 0 ? void 0 : onBackClicked(); } }))), _jsx(ButtonStyled, __assign({ disabled: disabled, isLoading: btnLoading, type: !btnLoading ? 'submit' : 'button', isBack: isBackEnabled, endIcon: btnLoading === false ? !disableNextIcon && _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) : undefined }, props, { children: !btnLoading ? (_jsxs(Text, __assign({ sx: { marginInlineEnd: isBackEnabled ? '-24px' : '-15px' } }, { children: [" ", children] }))) : (_jsx(Loader, { innerColor: 'white', outerColor: 'white', size: 15, toggleAnimation: !!btnLoading })) }))] }))] }));
|
|
117
116
|
}
|
|
@@ -163,6 +163,7 @@ export default function FlowsButtons(_a) {
|
|
|
163
163
|
var isAr = useLanguage().isAr;
|
|
164
164
|
var t = useTranslation().t;
|
|
165
165
|
var onRedirect = function (item) {
|
|
166
|
+
var _a;
|
|
166
167
|
if (!item.href)
|
|
167
168
|
return;
|
|
168
169
|
var name = item.name === FlowsTypes.BANK ? 'Wallet' : capitalize(item.name);
|
|
@@ -180,7 +181,7 @@ export default function FlowsButtons(_a) {
|
|
|
180
181
|
return;
|
|
181
182
|
}
|
|
182
183
|
if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
|
|
183
|
-
settingsData.appConfig.onBoardButtonClick({ name: item.name, token: item.token });
|
|
184
|
+
settingsData.appConfig.onBoardButtonClick({ name: item.name, token: item.token, countryCode: (_a = settingsData.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2 });
|
|
184
185
|
return;
|
|
185
186
|
}
|
|
186
187
|
dispatch(handleOpen(false));
|
|
@@ -241,6 +242,6 @@ export default function FlowsButtons(_a) {
|
|
|
241
242
|
onResetPassword();
|
|
242
243
|
else
|
|
243
244
|
onRedirect({ title: title, href: href, src: src, hoverSrc: hoverSrc, isCompleted: isCompleted, name: name, status: status, token: token });
|
|
244
|
-
} }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', disabled: isResetPassword(name, status) && loading, isCompleted: isCompleted, hasUrl: !!href, sx: __assign({ mb: isLast ? 2.5 : 1.8 }, sx), endIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsxs("div", __assign({ style: { display: 'flex', alignItems: 'center' } }, { children: [name !== 'password' && _jsx(Dot, { completed: ['complete', 'completed', 'reviewed'].includes(status === null || status === void 0 ? void 0 : status.toLowerCase()) }), _jsx(Image, { sx: { height: 15, transform: isAr ? 'scale(-1)' : 'scale(1)', marginInlineStart: 0 }, src: ICONS_NAMES.Arrow_filled_right_icon })] }))), startIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isBrand(name) ? (_jsx(_Fragment, { children: _jsx(BrandImage, { children: _jsx(BrandNameStyled, { children: brandName }) }) })) : (_jsx(Image, { src: src, alt: title })), type: 'button' }, { children: title })) }), idx));
|
|
245
|
+
} }, { children: _jsx(ButtonStyled, __assign({ variant: 'outlined', disabled: isResetPassword(name, status) && loading, isCompleted: isCompleted, hasUrl: !!href, sx: __assign({ mb: isLast ? 2.5 : 1.8 }, sx), endIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isCompleted ? (_jsx(CheckIconStyled, {})) : (_jsxs("div", __assign({ style: { display: 'flex', alignItems: 'center' } }, { children: [name !== 'password' && name !== 'terminal' && (_jsx(Dot, { completed: ['complete', 'completed', 'reviewed'].includes(status === null || status === void 0 ? void 0 : status.toLowerCase()) })), _jsx(Image, { sx: { height: 15, transform: isAr ? 'scale(-1)' : 'scale(1)', marginInlineStart: 0 }, src: ICONS_NAMES.Arrow_filled_right_icon })] }))), startIcon: isResetPassword(name, status) && loading ? (_jsx(_Fragment, {})) : isBrand(name) ? (_jsx(_Fragment, { children: _jsx(BrandImage, { children: _jsx(BrandNameStyled, { children: brandName }) }) })) : (_jsx(Image, { src: src, alt: title })), type: 'button' }, { children: title })) }), idx));
|
|
245
246
|
}), onClose && (_jsx(SharedButton, __assign({ sx: { mt: 2.5, ml: 0, mr: 0 }, isAr: isAr, disableBack: true, loading: storeLoading, onClick: onClose }, { children: t('close_and_complete_later') })))] }));
|
|
246
247
|
}
|
|
@@ -20,7 +20,7 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
|
|
|
20
20
|
warningType?: "alert" | "error" | "hint" | undefined;
|
|
21
21
|
} & {} & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
22
22
|
export interface CustomInputProps extends InputProps {
|
|
23
|
-
label?: string;
|
|
23
|
+
label?: string | JSX.Element;
|
|
24
24
|
required?: boolean;
|
|
25
25
|
labelSx?: SxProps<Theme>;
|
|
26
26
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PushNotificationProps {
|
|
3
|
+
success: boolean;
|
|
4
|
+
failed?: boolean;
|
|
5
|
+
expiryInSeconds: number;
|
|
6
|
+
onFinish?: () => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
error: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ success, failed, expiryInSeconds, onFinish, children, error }: PushNotificationProps) => JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { useCountDown, useCountUp } from '../../../hooks';
|
|
16
|
+
import Warning from '../../../components/Warning';
|
|
17
|
+
import { ScreenContainer } from '../../shared/Containers';
|
|
18
|
+
var PushNotification = function (_a) {
|
|
19
|
+
var success = _a.success, failed = _a.failed, expiryInSeconds = _a.expiryInSeconds, onFinish = _a.onFinish, children = _a.children, error = _a.error;
|
|
20
|
+
var t = useTranslation().t;
|
|
21
|
+
var count = useCountUp({ start: 0, end: expiryInSeconds, sleepMS: 1000 }).count;
|
|
22
|
+
var errorWaitingTime = 3;
|
|
23
|
+
var failedCount = useCountDown({ startTimer: !!failed, start: errorWaitingTime, end: 0, sleepMS: 1000 }).count;
|
|
24
|
+
var remainingTime = expiryInSeconds - errorWaitingTime;
|
|
25
|
+
var isEnded = failed ? failedCount === 0 : count === expiryInSeconds;
|
|
26
|
+
var endPhaseStarted = count >= remainingTime;
|
|
27
|
+
React.useEffect(function () {
|
|
28
|
+
if (isEnded && onFinish)
|
|
29
|
+
onFinish();
|
|
30
|
+
}, [isEnded]);
|
|
31
|
+
var isErrorPhase = (endPhaseStarted && !success) || failed;
|
|
32
|
+
return (_jsxs(ScreenContainer, { children: [children, isErrorPhase && _jsx(Warning, __assign({ sx: { mt: 2 } }, { children: t(error) }))] }));
|
|
33
|
+
};
|
|
34
|
+
export default React.memo(PushNotification);
|
|
@@ -72,7 +72,8 @@ var SuccessFlowButtons = function (_a) {
|
|
|
72
72
|
{ name: 'entity', status: entity === null || entity === void 0 ? void 0 : entity.data_state },
|
|
73
73
|
{ name: 'bank', status: bank === null || bank === void 0 ? void 0 : bank.data_state },
|
|
74
74
|
{ name: 'tax', status: entity === null || entity === void 0 ? void 0 : entity.tax_data_state },
|
|
75
|
-
{ name: 'individual', status: individuals === null || individuals === void 0 ? void 0 : individuals.data_state }
|
|
75
|
+
{ name: 'individual', status: individuals === null || individuals === void 0 ? void 0 : individuals.data_state },
|
|
76
|
+
{ name: 'terminal', status: '' }
|
|
76
77
|
];
|
|
77
78
|
var reMapFlowData = function (flows) {
|
|
78
79
|
if (flows === void 0) { flows = []; }
|
|
@@ -117,7 +118,6 @@ var SuccessFlowButtons = function (_a) {
|
|
|
117
118
|
}, [flows, isAr]);
|
|
118
119
|
useEffect(function () {
|
|
119
120
|
var _a, _b;
|
|
120
|
-
console.log('status', status);
|
|
121
121
|
if ((status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) === 'complete') {
|
|
122
122
|
(_b = (_a = settings.data.appConfig).onBoardCompleted) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
123
123
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
export interface ThankYouProps {
|
|
3
4
|
title?: string;
|
|
@@ -9,6 +10,7 @@ export interface ThankYouProps {
|
|
|
9
10
|
description?: string | React.ReactElement;
|
|
10
11
|
enableBack?: boolean;
|
|
11
12
|
onBack?: () => void;
|
|
13
|
+
sx?: SxProps<Theme>;
|
|
12
14
|
}
|
|
13
|
-
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack }: ThankYouProps) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error, enableBack, onBack, sx }: ThankYouProps) => JSX.Element>;
|
|
14
16
|
export default _default;
|
|
@@ -55,9 +55,9 @@ var IconStyled = styled(Icon)(function (_a) {
|
|
|
55
55
|
_b);
|
|
56
56
|
});
|
|
57
57
|
var ThankYou = function (_a) {
|
|
58
|
-
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack;
|
|
58
|
+
var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error, enableBack = _a.enableBack, onBack = _a.onBack, sx = _a.sx;
|
|
59
59
|
var t = useTranslation().t;
|
|
60
60
|
var isAr = useLanguage().isAr;
|
|
61
|
-
return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), description && _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] }));
|
|
61
|
+
return (_jsxs(ContainerStyled, __assign({ sx: sx }, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), description && _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) })), enableBack && (_jsx(Button, __assign({ sx: { mb: 1.5, mt: 0 }, onClick: function () { return onBack === null || onBack === void 0 ? void 0 : onBack(); }, variant: 'text' }, { children: t('back') })))] })));
|
|
62
62
|
};
|
|
63
63
|
export default React.memo(ThankYou);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LibConfig } from '../../@types';
|
|
3
|
+
export interface TerminalLibProps extends LibConfig {
|
|
4
|
+
verifyToken?: string;
|
|
5
|
+
configToken?: string;
|
|
6
|
+
loaderColor?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TerminalLibFullProps extends TerminalLibProps {
|
|
9
|
+
unmount?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function TerminalElement(props: TerminalLibFullProps): JSX.Element;
|
|
12
|
+
export declare function renderTerminalLib(config: TerminalLibProps, elementId: string): {
|
|
13
|
+
unmount: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import React, { memo } from 'react';
|
|
25
|
+
import { createRoot } from 'react-dom/client';
|
|
26
|
+
import { useAppTheme, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useVerifyToken, useAppDispatch } from '../../hooks';
|
|
27
|
+
import { handleCurrentActiveScreen, settingsSelector } from '../../app/settings';
|
|
28
|
+
import { store } from '../../app/store';
|
|
29
|
+
import AnimationFlow from '../../components/AnimationFlow';
|
|
30
|
+
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
31
|
+
import Collapse from '../../components/Collapse';
|
|
32
|
+
import { findOrCreateElementAndInject, initializeGTM, sendPageView } from '../../utils';
|
|
33
|
+
import { CONNECT_FLOWS, TERMINAL_SCREENS_NAVIGATION } from '../../constants';
|
|
34
|
+
import { FeatureContainer } from '../shared/Containers';
|
|
35
|
+
import { terminalSelector, verifyToken as verifyTokenAPI } from '../app/terminal/terminalStore';
|
|
36
|
+
import { terminalFeatureScreens } from '../featuresScreens';
|
|
37
|
+
import Background from '../shared/Background';
|
|
38
|
+
var Terminal = memo(function (_a) {
|
|
39
|
+
var _b, _c;
|
|
40
|
+
var configToken = _a.configToken, verifyToken = _a.verifyToken, loaderColor = _a.loaderColor, props = __rest(_a, ["configToken", "verifyToken", "loaderColor"]);
|
|
41
|
+
var theme = useAppTheme().theme;
|
|
42
|
+
var dispatch = useAppDispatch();
|
|
43
|
+
var _d = useAppSelector(settingsSelector), data = _d.data, error = _d.error, settingLoading = _d.loading;
|
|
44
|
+
var _e = useAppSelector(terminalSelector), customLoading = _e.customLoading, terminalError = _e.error, loading = _e.loading, terminalListLoading = _e.terminalListLoading;
|
|
45
|
+
useAppConfig(__assign(__assign({ navigation: TERMINAL_SCREENS_NAVIGATION }, props), { disableSettingFetching: props.mode === 'content' ? false : !!verifyToken || !!configToken }));
|
|
46
|
+
useErrorListener(terminalError || error);
|
|
47
|
+
useStepStartedListener();
|
|
48
|
+
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, featureScreensNavigation = data.featureScreensNavigation, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress, appConfig = data.appConfig;
|
|
49
|
+
var animationDirection = open ? (_b = appConfig.features) === null || _b === void 0 ? void 0 : _b.dialogStartTransition : (_c = appConfig.features) === null || _c === void 0 ? void 0 : _c.dialogEndTransition;
|
|
50
|
+
var verifyTokenAndMoveToNextScreen = function (_a) {
|
|
51
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
52
|
+
return function () {
|
|
53
|
+
dispatch(verifyTokenAPI({ token: token, isInternally: isInternally }))
|
|
54
|
+
.unwrap()
|
|
55
|
+
.then(function (_a) {
|
|
56
|
+
var nextScreen = _a.nextScreen;
|
|
57
|
+
dispatch(handleCurrentActiveScreen(nextScreen));
|
|
58
|
+
})
|
|
59
|
+
.catch(function () { });
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
useVerifyToken({
|
|
63
|
+
verify: verifyTokenAndMoveToNextScreen,
|
|
64
|
+
loadingScreenName: CONNECT_FLOWS.terminal.loadingData,
|
|
65
|
+
navigation: featureScreensNavigation,
|
|
66
|
+
open: open,
|
|
67
|
+
mode: props.mode,
|
|
68
|
+
internalToken: verifyToken,
|
|
69
|
+
settingLoading: settingLoading,
|
|
70
|
+
operatorErrorScreenName: CONNECT_FLOWS.terminal.operatorError,
|
|
71
|
+
isValidOperator: data.isValidOperator
|
|
72
|
+
});
|
|
73
|
+
React.useEffect(function () {
|
|
74
|
+
initializeGTM();
|
|
75
|
+
sendPageView({
|
|
76
|
+
title: 'Terminal'
|
|
77
|
+
});
|
|
78
|
+
}, []);
|
|
79
|
+
var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
|
|
80
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading || terminalListLoading ? 'none' : 'auto', isTapOrigin: isTapOrigin, animationDirection: animationDirection, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: terminalFeatureScreens.map(function (_a, index) {
|
|
81
|
+
var Element = _a.element, name = _a.name;
|
|
82
|
+
var isActive = activeScreen.name === name;
|
|
83
|
+
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
84
|
+
}) })) })) })) })));
|
|
85
|
+
});
|
|
86
|
+
export function TerminalElement(props) {
|
|
87
|
+
return (_jsx(ReduxProvider, __assign({ store: store }, { children: _jsx(Terminal, __assign({}, props)) })));
|
|
88
|
+
}
|
|
89
|
+
export function renderTerminalLib(config, elementId) {
|
|
90
|
+
var element = findOrCreateElementAndInject(elementId);
|
|
91
|
+
var root = createRoot(element);
|
|
92
|
+
var unmount = function () { return root.unmount(); };
|
|
93
|
+
root.render(_jsx(TerminalElement, __assign({}, config, { unmount: unmount })));
|
|
94
|
+
return { unmount: unmount };
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Terminal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Terminal';
|