@tap-payments/auth-jsconnect 1.0.90-test → 1.0.94-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -52
- package/build/@types/app.d.ts +9 -0
- package/build/@types/app.js +9 -0
- package/build/@types/form.d.ts +2 -0
- package/build/api/account.js +1 -1
- package/build/api/auth.js +1 -1
- package/build/api/availabilityServices.js +1 -1
- package/build/api/axios.d.ts +2 -0
- package/build/api/axios.js +4 -2
- package/build/api/country.js +1 -1
- package/build/api/data.js +1 -1
- package/build/api/entity.js +1 -1
- package/build/api/firebase.js +1 -1
- package/build/api/individual.js +1 -1
- package/build/api/ip.js +1 -1
- package/build/api/lead.js +1 -1
- package/build/api/operator.js +1 -1
- package/build/app/rootReducer.d.ts +6 -7
- package/build/app/rootReducer.js +7 -9
- package/build/app/settings.d.ts +9 -3
- package/build/app/settings.js +42 -6
- package/build/app/store.d.ts +0 -2
- package/build/components/AnimationFlow/BottomSheet.js +1 -1
- package/build/components/AnimationFlow/Dialog.js +2 -2
- package/build/components/AnimationFlow/Loader.js +1 -1
- package/build/components/DatePicker/DatePicker.js +3 -3
- package/build/components/DatePicker/customStyle.css +86 -0
- package/build/components/Footer/Footer.d.ts +0 -2
- package/build/components/Footer/Footer.js +3 -4
- package/build/components/Input/Input.js +2 -2
- package/build/components/OTPTimer/OTPTimer.js +1 -1
- package/build/components/Providers/ThemeProvider.d.ts +1 -1
- package/build/components/SimpleList/SimpleList.js +1 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +2 -2
- package/build/constants/app.d.ts +1 -2
- package/build/constants/app.js +1 -9
- package/build/features/app/bank/bankStore.d.ts +6 -2
- package/build/features/app/bank/bankStore.js +42 -5
- package/build/features/app/business/businessStore.d.ts +8 -10
- package/build/features/app/business/businessStore.js +42 -44
- package/build/features/app/connect/connectStore.d.ts +3 -8
- package/build/features/app/connect/connectStore.js +27 -61
- package/build/features/app/individual/individualStore.d.ts +7 -8
- package/build/features/app/individual/individualStore.js +53 -48
- package/build/features/app/password/passwordStore.d.ts +6 -2
- package/build/features/app/password/passwordStore.js +41 -5
- package/build/features/app/tax/taxStore.d.ts +6 -2
- package/build/features/app/tax/taxStore.js +43 -6
- package/build/features/bank/Bank.d.ts +1 -1
- package/build/features/bank/Bank.js +13 -12
- package/build/features/bank/screens/BankDetails/BankDetails.js +10 -9
- package/build/features/bank/screens/BankDetails/BankName.js +8 -8
- package/build/features/bank/screens/BankDetails/Beneficiary.js +7 -7
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +67 -0
- package/build/features/bank/screens/BankDetails/IBAN.js +8 -8
- package/build/features/bank/screens/BankDetails/validation.d.ts +3 -0
- package/build/features/bank/screens/BankDetails/validation.js +3 -2
- package/build/features/bank/screens/Success/Success.js +3 -3
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/bank/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/bank/screens/Verify/OTPInput.js +8 -3
- package/build/features/bank/screens/Verify/Verify.js +12 -11
- package/build/features/business/Business.d.ts +1 -1
- package/build/features/business/Business.js +13 -15
- package/build/features/business/screens/Activities/Activities.js +7 -7
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
- package/build/features/business/screens/Activities/ActivitiesList.js +9 -9
- package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
- package/build/features/business/screens/Activities/SalesChannels.d.ts +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +7 -7
- package/build/features/business/screens/BusinessType/BusinessType.js +8 -8
- package/build/features/business/screens/BusinessType/LicenseList.js +10 -10
- package/build/features/business/screens/BusinessType/LicenseNumber.js +8 -8
- package/build/features/business/screens/BusinessType/SelectType.js +6 -6
- package/build/features/business/screens/BusinessType/validation.js +2 -2
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.js +8 -8
- package/build/features/business/screens/Customers/Customers.js +8 -8
- package/build/features/business/screens/Customers/ExpectedCustomers.js +6 -6
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -7
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +2 -2
- package/build/features/business/screens/Customers/RefundPolicy.js +7 -7
- package/build/features/business/screens/Customers/TransactionPolicy.js +5 -5
- package/build/features/business/screens/IDBOD/DOB.js +5 -5
- package/build/features/business/screens/IDBOD/ID.js +6 -6
- package/build/features/business/screens/IDBOD/IDBOD.js +6 -6
- package/build/features/business/screens/OTP/OTP.js +9 -9
- package/build/features/business/screens/OTP/OTPInput.js +4 -4
- package/build/features/business/screens/Success/Success.js +3 -3
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -9
- package/build/features/business/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/business/screens/Verify/OTPInput.js +8 -3
- package/build/features/business/screens/Verify/Verify.js +12 -11
- package/build/features/connect/Connect.d.ts +1 -1
- package/build/features/connect/Connect.js +14 -16
- package/build/features/connect/screens/Individual/Email.js +7 -7
- package/build/features/connect/screens/Individual/Individual.js +9 -9
- package/build/features/connect/screens/Individual/MobileNumber.d.ts +1 -1
- package/build/features/connect/screens/Individual/MobileNumber.js +11 -11
- package/build/features/connect/screens/Individual/Name.js +6 -6
- package/build/features/connect/screens/Individual/validation.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.d.ts +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +8 -8
- package/build/features/connect/screens/Merchant/BrandName.js +12 -11
- package/build/features/connect/screens/Merchant/Merchant.js +7 -7
- package/build/features/connect/screens/Merchant/SocialMedia.js +9 -9
- package/build/features/connect/screens/Merchant/TAC.js +7 -7
- package/build/features/connect/screens/Merchant/validation.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +10 -10
- package/build/features/connect/screens/Mobile/MobileNumber.d.ts +1 -1
- package/build/features/connect/screens/Mobile/MobileNumber.js +12 -12
- package/build/features/connect/screens/Mobile/Title.js +2 -2
- package/build/features/connect/screens/NID/DOB.js +5 -5
- package/build/features/connect/screens/NID/IDNumber.js +8 -8
- package/build/features/connect/screens/NID/NID.js +9 -9
- package/build/features/connect/screens/OTP/OTP.js +9 -9
- package/build/features/connect/screens/OTP/OTPInput.js +4 -4
- package/build/features/connect/screens/ThankYou/ThankYou.js +3 -3
- package/build/features/featuresScreens.d.ts +1 -2
- package/build/features/featuresScreens.js +30 -37
- package/build/features/individual/Individual.d.ts +1 -1
- package/build/features/individual/Individual.js +13 -15
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +11 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +9 -9
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +6 -6
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +8 -8
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -1
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +6 -6
- package/build/features/individual/screens/ShowIndividualInfo/info.js +1 -1
- package/build/features/individual/screens/Success/Success.js +3 -3
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/individual/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/individual/screens/Verify/OTPInput.js +8 -3
- package/build/features/individual/screens/Verify/Verify.js +12 -11
- package/build/features/password/Password.d.ts +1 -1
- package/build/features/password/Password.js +13 -12
- package/build/features/password/screens/CreatePassword/ConditionText.js +1 -1
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -3
- package/build/features/password/screens/CreatePassword/CreatePassword.js +7 -7
- package/build/features/password/screens/CreatePassword/Password.js +6 -6
- package/build/features/password/screens/Success/Success.js +3 -3
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/password/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/password/screens/Verify/OTPInput.js +8 -3
- package/build/features/password/screens/Verify/Verify.js +12 -11
- package/build/features/shared/AcceptancePayouts/AcceptancePayouts.js +4 -4
- package/build/features/shared/Background/Background.js +3 -2
- package/build/features/shared/Background/LogoBackground.d.ts +1 -4
- package/build/features/shared/Background/LogoBackground.js +8 -39
- package/build/features/shared/Button/AbsherButton.d.ts +2 -3
- package/build/features/shared/Button/AbsherButton.js +7 -12
- package/build/features/shared/Button/Button.d.ts +1 -1
- package/build/features/shared/Button/Button.js +7 -7
- package/build/features/shared/Button/EmailProvidersButtons.d.ts +1 -1
- package/build/features/shared/Button/EmailProvidersButtons.js +4 -3
- package/build/features/shared/Button/FlowsButtons.d.ts +5 -2
- package/build/features/shared/Button/FlowsButtons.js +14 -9
- package/build/features/shared/Button/MobileButton.d.ts +2 -3
- package/build/features/shared/Button/MobileButton.js +7 -12
- package/build/features/shared/Button/SuccessButton.js +1 -1
- package/build/features/shared/Footer/Footer.js +5 -6
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/shared/Input/Input.js +2 -2
- package/build/features/shared/OTP/OTP.d.ts +3 -2
- package/build/features/shared/OTP/OTP.js +13 -5
- package/build/features/shared/Search/Search.js +1 -1
- package/build/features/shared/SearchIcon/SearchIcon.js +2 -2
- package/build/features/shared/SuccessScreen/SuccessScreen.js +5 -5
- package/build/features/tax/Tax.d.ts +1 -1
- package/build/features/tax/Tax.js +13 -12
- package/build/features/tax/screens/Success/Success.js +3 -3
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +10 -10
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +66 -0
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +11 -8
- package/build/features/tax/screens/TaxDetails/VATId.js +18 -7
- package/build/features/tax/screens/TaxDetails/validation.d.ts +3 -0
- package/build/features/tax/screens/TaxDetails/validation.js +2 -1
- package/build/features/tax/screens/Verify/OTPInput.d.ts +3 -1
- package/build/features/tax/screens/Verify/OTPInput.js +8 -3
- package/build/features/tax/screens/Verify/Verify.js +12 -11
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.d.ts +1 -1
- package/build/hooks/useAppConfig.js +7 -4
- package/build/hooks/useAppDispatch.d.ts +0 -1
- package/build/hooks/useAppSelector.d.ts +1 -1
- package/build/hooks/useAppTheme.d.ts +1 -1
- package/build/hooks/useAppTheme.js +3 -3
- package/build/hooks/useErrorListener.d.ts +1 -1
- package/build/hooks/useErrorListener.js +5 -7
- package/build/hooks/useLanguage.js +1 -1
- package/build/hooks/useRedirectionListener.js +1 -1
- package/build/hooks/useStepStartedListener.d.ts +1 -0
- package/build/hooks/useStepStartedListener.js +10 -0
- package/build/i18n.js +1 -1
- package/build/index.css +135 -0
- package/build/index.d.ts +8 -9
- package/build/index.js +8 -11
- package/build/theme/theme.d.ts +1 -1
- package/build/utils/locale.d.ts +1 -1
- package/build/utils/locale.js +1 -1
- package/build/utils/rsa.js +1 -1
- package/build/utils/string.d.ts +2 -1
- package/build/utils/string.js +22 -3
- package/package.json +127 -127
- package/build/features/Landing/Landing.d.ts +0 -7
- package/build/features/Landing/Landing.js +0 -55
- package/build/features/Landing/index.d.ts +0 -1
- package/build/features/Landing/index.js +0 -1
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.d.ts +0 -5
- package/build/features/Landing/screens/VerifyAndRedirect/VerifyAndRedirect.js +0 -41
- package/build/features/Landing/screens/VerifyAndRedirect/index.d.ts +0 -2
- package/build/features/Landing/screens/VerifyAndRedirect/index.js +0 -2
- package/build/features/app/landing/landingStore.d.ts +0 -22
- package/build/features/app/landing/landingStore.js +0 -103
|
@@ -47,26 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import API from '
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
|
|
55
|
-
var settings, countriesBody, businessCountry;
|
|
56
|
-
return __generator(this, function (_a) {
|
|
57
|
-
switch (_a.label) {
|
|
58
|
-
case 0:
|
|
59
|
-
settings = thunkApi.getState().settings;
|
|
60
|
-
return [4, API.countryService.getAllCountries()];
|
|
61
|
-
case 1:
|
|
62
|
-
countriesBody = (_a.sent()).data;
|
|
63
|
-
businessCountry = (countriesBody.list || []).find(function (country) {
|
|
64
|
-
return [country.iso2, country.iso3].includes(settings.data.appConfig.businessCountryCode.toUpperCase());
|
|
65
|
-
});
|
|
66
|
-
return [2, { businessCountry: businessCountry, countries: countriesBody.list }];
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}); });
|
|
50
|
+
import API from '../../../api';
|
|
51
|
+
import { FlowsTypes } from '../../../@types';
|
|
52
|
+
import { hasKey, removeRequestHeaders } from '../../../utils';
|
|
53
|
+
import { handleNextScreenStep } from '../../../app/settings';
|
|
54
|
+
import { INDIVIDUAl_STEP_NAMES } from '../../../constants';
|
|
70
55
|
export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
56
|
var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
|
|
72
57
|
var _b, _c;
|
|
@@ -104,20 +89,41 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
|
|
|
104
89
|
}
|
|
105
90
|
});
|
|
106
91
|
}); });
|
|
92
|
+
export var resendOTP = createAsyncThunk('resendOTPIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
93
|
+
var individual, payload, data;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
individual = thunkApi.getState().individual;
|
|
98
|
+
payload = {
|
|
99
|
+
service_name: 'tap_email',
|
|
100
|
+
verify_token: individual.data.verify.token
|
|
101
|
+
};
|
|
102
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
103
|
+
case 1:
|
|
104
|
+
data = (_a.sent()).data;
|
|
105
|
+
return [2, { data: data }];
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}); });
|
|
107
109
|
export var retrieveDataList = createAsyncThunk('retrieveDataList', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
108
|
-
var _a, sourceIncome, monthlyIncome;
|
|
110
|
+
var settings, _a, sourceIncome, monthlyIncome, countries;
|
|
109
111
|
return __generator(this, function (_b) {
|
|
110
112
|
switch (_b.label) {
|
|
111
|
-
case 0:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
case 0:
|
|
114
|
+
settings = thunkApi.getState().settings;
|
|
115
|
+
return [4, Promise.all([
|
|
116
|
+
API.dataService.getSourceOfIncome(),
|
|
117
|
+
API.dataService.getMonthlyIncome(countryCode)
|
|
118
|
+
])];
|
|
115
119
|
case 1:
|
|
116
120
|
_a = _b.sent(), sourceIncome = _a[0].data, monthlyIncome = _a[1].data;
|
|
121
|
+
countries = settings.data.countries;
|
|
117
122
|
return [2, {
|
|
118
123
|
sourceIncome: sourceIncome,
|
|
119
124
|
monthlyIncome: monthlyIncome,
|
|
120
|
-
countryCode: countryCode
|
|
125
|
+
countryCode: countryCode,
|
|
126
|
+
countries: countries
|
|
121
127
|
}];
|
|
122
128
|
}
|
|
123
129
|
});
|
|
@@ -185,7 +191,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
|
|
|
185
191
|
actual_income: (_f = params.monthlyIncome) === null || _f === void 0 ? void 0 : _f.id,
|
|
186
192
|
is_relative_PEP: params.isPEP,
|
|
187
193
|
is_influencer: params.isInfluencer,
|
|
188
|
-
encryption_contract: ['employer_name', 'employer_city', 'actual_income'
|
|
194
|
+
encryption_contract: ['employer_name', 'employer_city', 'actual_income'],
|
|
189
195
|
step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
|
|
190
196
|
};
|
|
191
197
|
return [4, API.entityService.updateEntityInfo(requestBody)];
|
|
@@ -231,8 +237,7 @@ var initialState = {
|
|
|
231
237
|
error: null,
|
|
232
238
|
loading: false,
|
|
233
239
|
data: {
|
|
234
|
-
|
|
235
|
-
businessCountry: defaultCountry,
|
|
240
|
+
flowName: FlowsTypes.INDIVIDUAL,
|
|
236
241
|
verify: {
|
|
237
242
|
token: ''
|
|
238
243
|
},
|
|
@@ -265,23 +270,6 @@ export var individualSlice = createSlice({
|
|
|
265
270
|
},
|
|
266
271
|
extraReducers: function (builder) {
|
|
267
272
|
builder
|
|
268
|
-
.addCase(getCountries.fulfilled, function (state, action) {
|
|
269
|
-
state.error = null;
|
|
270
|
-
state.customLoading = false;
|
|
271
|
-
var _a = action.payload, countries = _a.countries, businessCountry = _a.businessCountry;
|
|
272
|
-
state.data.countries = countries
|
|
273
|
-
.slice()
|
|
274
|
-
.sort(function (cOne, cTwo) { return cOne.name.english.localeCompare(cTwo.name.english); });
|
|
275
|
-
state.data.businessCountry = businessCountry || defaultCountry;
|
|
276
|
-
})
|
|
277
|
-
.addCase(getCountries.pending, function (state) {
|
|
278
|
-
state.error = null;
|
|
279
|
-
state.customLoading = true;
|
|
280
|
-
})
|
|
281
|
-
.addCase(getCountries.rejected, function (state, action) {
|
|
282
|
-
state.error = action.error.message;
|
|
283
|
-
state.customLoading = false;
|
|
284
|
-
})
|
|
285
273
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
286
274
|
state.error = null;
|
|
287
275
|
state.customLoading = true;
|
|
@@ -302,6 +290,23 @@ export var individualSlice = createSlice({
|
|
|
302
290
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
303
291
|
state.error = action.error.message;
|
|
304
292
|
state.customLoading = false;
|
|
293
|
+
})
|
|
294
|
+
.addCase(resendOTP.pending, function (state) {
|
|
295
|
+
state.error = null;
|
|
296
|
+
})
|
|
297
|
+
.addCase(resendOTP.fulfilled, function (state, action) {
|
|
298
|
+
var _a;
|
|
299
|
+
state.error = null;
|
|
300
|
+
var data = action.payload.data;
|
|
301
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
302
|
+
if (description) {
|
|
303
|
+
state.error = description;
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
307
|
+
})
|
|
308
|
+
.addCase(resendOTP.rejected, function (state, action) {
|
|
309
|
+
state.error = action.error.message;
|
|
305
310
|
})
|
|
306
311
|
.addCase(verifyLeadOTP.pending, function (state) {
|
|
307
312
|
state.loading = true;
|
|
@@ -331,7 +336,7 @@ export var individualSlice = createSlice({
|
|
|
331
336
|
.addCase(retrieveDataList.fulfilled, function (state, action) {
|
|
332
337
|
state.loading = false;
|
|
333
338
|
state.error = null;
|
|
334
|
-
var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, countryCode = _a.countryCode;
|
|
339
|
+
var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, countryCode = _a.countryCode, countries = _a.countries;
|
|
335
340
|
var data = state.data.individualData.responseBody;
|
|
336
341
|
state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [], monthlyIncomeList: monthlyIncome || [] });
|
|
337
342
|
var selectedSourceIncome = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome[0];
|
|
@@ -341,7 +346,7 @@ export var individualSlice = createSlice({
|
|
|
341
346
|
if (!!selectedMonthlyIncome)
|
|
342
347
|
state.data.individualData.monthlyIncome = selectedMonthlyIncome;
|
|
343
348
|
if (!!countryCode) {
|
|
344
|
-
var employerLocation =
|
|
349
|
+
var employerLocation = countries.find(function (country) { return country.iso2 === countryCode; });
|
|
345
350
|
state.data.individualData.employerLocation = employerLocation;
|
|
346
351
|
}
|
|
347
352
|
})
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { RootState } from '
|
|
2
|
-
import { OTPFormValues, PasswordCreateFormValues, ResponseData, SharedState } from '
|
|
1
|
+
import { RootState } from '../../../app/store';
|
|
2
|
+
import { FlowsTypes, OTPFormValues, PasswordCreateFormValues, ResponseData, SharedState } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
leadData: any;
|
|
6
6
|
token: string;
|
|
7
7
|
}, string, {}>;
|
|
8
|
+
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
|
+
data: any;
|
|
10
|
+
}, void, {}>;
|
|
8
11
|
export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
12
|
data: any;
|
|
10
13
|
}, string, {}>;
|
|
@@ -29,6 +32,7 @@ export interface PasswordData {
|
|
|
29
32
|
verify: ResponseData & VerifyData;
|
|
30
33
|
otpData: OTPFormValues & ResponseData;
|
|
31
34
|
passwordData: PasswordCreateFormValues & ResponseData;
|
|
35
|
+
flowName: FlowsTypes;
|
|
32
36
|
}
|
|
33
37
|
export interface PasswordState extends SharedState<PasswordData> {
|
|
34
38
|
}
|
|
@@ -47,10 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import API from '
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
50
|
+
import API from '../../../api';
|
|
51
|
+
import { FlowsTypes } from '../../../@types';
|
|
52
|
+
import { hasKey, removeRequestHeaders } from '../../../utils';
|
|
53
|
+
import { handleNextScreenStep } from '../../../app/settings';
|
|
54
|
+
import { PASSWORD_STEP_NAMES } from '../../../constants';
|
|
54
55
|
export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
56
|
var payload, data, leadResponse, _a, steps, entity, hasCompleted;
|
|
56
57
|
return __generator(this, function (_b) {
|
|
@@ -85,6 +86,23 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
|
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
}); });
|
|
89
|
+
export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
+
var password, payload, data;
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
password = thunkApi.getState().password;
|
|
95
|
+
payload = {
|
|
96
|
+
service_name: 'tap_email',
|
|
97
|
+
verify_token: password.data.verify.token
|
|
98
|
+
};
|
|
99
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
100
|
+
case 1:
|
|
101
|
+
data = (_a.sent()).data;
|
|
102
|
+
return [2, { data: data }];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); });
|
|
88
106
|
export var retrieveEntityInfo = createAsyncThunk('retrievePasswordEntityInfo', function (entityID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
107
|
var data;
|
|
90
108
|
return __generator(this, function (_a) {
|
|
@@ -187,6 +205,7 @@ var initialState = {
|
|
|
187
205
|
error: null,
|
|
188
206
|
loading: false,
|
|
189
207
|
data: {
|
|
208
|
+
flowName: FlowsTypes.PASSWORD,
|
|
190
209
|
verify: {
|
|
191
210
|
token: ''
|
|
192
211
|
},
|
|
@@ -228,13 +247,30 @@ export var passwordSlice = createSlice({
|
|
|
228
247
|
state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
|
|
229
248
|
state.data.verify.token = token;
|
|
230
249
|
})
|
|
231
|
-
.addCase(verifyLeadToken.pending, function (state
|
|
250
|
+
.addCase(verifyLeadToken.pending, function (state) {
|
|
232
251
|
state.customLoading = true;
|
|
233
252
|
state.error = null;
|
|
234
253
|
})
|
|
235
254
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
236
255
|
state.error = action.error.message;
|
|
237
256
|
state.customLoading = false;
|
|
257
|
+
})
|
|
258
|
+
.addCase(resendOTP.pending, function (state) {
|
|
259
|
+
state.error = null;
|
|
260
|
+
})
|
|
261
|
+
.addCase(resendOTP.fulfilled, function (state, action) {
|
|
262
|
+
var _a;
|
|
263
|
+
state.error = null;
|
|
264
|
+
var data = action.payload.data;
|
|
265
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
266
|
+
if (description) {
|
|
267
|
+
state.error = description;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
271
|
+
})
|
|
272
|
+
.addCase(resendOTP.rejected, function (state, action) {
|
|
273
|
+
state.error = action.error.message;
|
|
238
274
|
})
|
|
239
275
|
.addCase(verifyPasswordLeadOTP.pending, function (state) {
|
|
240
276
|
state.loading = true;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { RootState } from '
|
|
2
|
-
import { OTPFormValues, ResponseData, SharedState, TaxFormValues } from '
|
|
1
|
+
import { RootState } from '../../../app/store';
|
|
2
|
+
import { FlowsTypes, OTPFormValues, ResponseData, SharedState, TaxFormValues } from '../../../@types';
|
|
3
3
|
export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
|
|
4
4
|
data: any;
|
|
5
5
|
leadData: any;
|
|
6
6
|
token: string;
|
|
7
7
|
}, string, {}>;
|
|
8
|
+
export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
|
+
data: any;
|
|
10
|
+
}, void, {}>;
|
|
8
11
|
export declare const retrieveEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
|
|
9
12
|
data: any;
|
|
10
13
|
}, string, {}>;
|
|
@@ -27,6 +30,7 @@ export interface TaxData {
|
|
|
27
30
|
verify: ResponseData & VerifyData;
|
|
28
31
|
otpData: OTPFormValues & ResponseData;
|
|
29
32
|
taxData: TaxFormValues & ResponseData;
|
|
33
|
+
flowName: FlowsTypes;
|
|
30
34
|
}
|
|
31
35
|
export interface TaxState extends SharedState<TaxData> {
|
|
32
36
|
}
|
|
@@ -47,10 +47,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import API from '
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
50
|
+
import API from '../../../api';
|
|
51
|
+
import { FlowsTypes } from '../../../@types';
|
|
52
|
+
import { hasKey, removeRequestHeaders } from '../../../utils';
|
|
53
|
+
import { handleNextScreenStep } from '../../../app/settings';
|
|
54
|
+
import { TAX_STEP_NAMES } from '../../../constants';
|
|
54
55
|
export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
56
|
var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
|
|
56
57
|
return __generator(this, function (_b) {
|
|
@@ -85,6 +86,23 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
|
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
88
|
}); });
|
|
89
|
+
export var resendOTP = createAsyncThunk('resendOTPTax', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
90
|
+
var tax, payload, data;
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
tax = thunkApi.getState().tax;
|
|
95
|
+
payload = {
|
|
96
|
+
service_name: 'tap_email',
|
|
97
|
+
verify_token: tax.data.verify.token
|
|
98
|
+
};
|
|
99
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
100
|
+
case 1:
|
|
101
|
+
data = (_a.sent()).data;
|
|
102
|
+
return [2, { data: data }];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}); });
|
|
88
106
|
export var retrieveEntityInfo = createAsyncThunk('retrieveTaxEntityInfo', function (entityID) { return __awaiter(void 0, void 0, void 0, function () {
|
|
89
107
|
var data;
|
|
90
108
|
return __generator(this, function (_a) {
|
|
@@ -186,6 +204,7 @@ var initialState = {
|
|
|
186
204
|
error: null,
|
|
187
205
|
loading: false,
|
|
188
206
|
data: {
|
|
207
|
+
flowName: FlowsTypes.TAX,
|
|
189
208
|
verify: {
|
|
190
209
|
token: ''
|
|
191
210
|
},
|
|
@@ -193,7 +212,8 @@ var initialState = {
|
|
|
193
212
|
otp: ''
|
|
194
213
|
},
|
|
195
214
|
taxData: {
|
|
196
|
-
vatId: ''
|
|
215
|
+
vatId: '',
|
|
216
|
+
confirmPolicy: false
|
|
197
217
|
}
|
|
198
218
|
}
|
|
199
219
|
};
|
|
@@ -226,13 +246,30 @@ export var taxSlice = createSlice({
|
|
|
226
246
|
state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
|
|
227
247
|
state.data.verify.token = token;
|
|
228
248
|
})
|
|
229
|
-
.addCase(verifyLeadToken.pending, function (state
|
|
249
|
+
.addCase(verifyLeadToken.pending, function (state) {
|
|
230
250
|
state.error = null;
|
|
231
251
|
state.customLoading = true;
|
|
232
252
|
})
|
|
233
253
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
234
254
|
state.error = action.error.message;
|
|
235
255
|
state.customLoading = false;
|
|
256
|
+
})
|
|
257
|
+
.addCase(resendOTP.pending, function (state) {
|
|
258
|
+
state.error = null;
|
|
259
|
+
})
|
|
260
|
+
.addCase(resendOTP.fulfilled, function (state, action) {
|
|
261
|
+
var _a;
|
|
262
|
+
state.error = null;
|
|
263
|
+
var data = action.payload.data;
|
|
264
|
+
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
265
|
+
if (description) {
|
|
266
|
+
state.error = description;
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
270
|
+
})
|
|
271
|
+
.addCase(resendOTP.rejected, function (state, action) {
|
|
272
|
+
state.error = action.error.message;
|
|
236
273
|
})
|
|
237
274
|
.addCase(verifyTaxLeadOTP.pending, function (state) {
|
|
238
275
|
state.loading = true;
|
|
@@ -11,26 +11,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { memo, useEffect } from 'react';
|
|
14
|
-
import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig } from '
|
|
15
|
-
import { handleLanguage, settingsSelector } from '
|
|
16
|
-
import AnimationFlow from '
|
|
17
|
-
import { store } from '
|
|
18
|
-
import { ReduxProvider, ThemeProvider } from '
|
|
19
|
-
import Collapse from '
|
|
20
|
-
import { getParameterByName, reactElement } from '
|
|
21
|
-
import { FeatureContainer } from '
|
|
22
|
-
import { BANK_SCREENS_NAVIGATION } from '
|
|
14
|
+
import { useAppTheme, useAppDispatch, useAppSelector, useErrorListener, useAppConfig, useStepStartedListener } from '../../hooks';
|
|
15
|
+
import { handleLanguage, settingsSelector } from '../../app/settings';
|
|
16
|
+
import AnimationFlow from '../../components/AnimationFlow';
|
|
17
|
+
import { store } from '../../app/store';
|
|
18
|
+
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
|
+
import Collapse from '../../components/Collapse';
|
|
20
|
+
import { getParameterByName, reactElement } from '../../utils';
|
|
21
|
+
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
+
import { BANK_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { bankFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
|
-
import { bankSelector, verifyLeadToken } from '
|
|
25
|
+
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
26
26
|
import Background from '../shared/Background';
|
|
27
27
|
var Bank = memo(function (props) {
|
|
28
28
|
var theme = useAppTheme().theme;
|
|
29
29
|
var dispatch = useAppDispatch();
|
|
30
30
|
var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
|
|
31
|
-
var
|
|
31
|
+
var _b = useAppSelector(bankSelector), customLoading = _b.customLoading, bankError = _b.error;
|
|
32
32
|
var loading = useAppConfig(__assign({ navigation: BANK_SCREENS_NAVIGATION }, props)).loading;
|
|
33
|
-
useErrorListener();
|
|
33
|
+
useErrorListener(bankError || error);
|
|
34
|
+
useStepStartedListener();
|
|
34
35
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
36
|
var verifyToken = function () {
|
|
36
37
|
var token = getParameterByName('token');
|
|
@@ -11,21 +11,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { ScreenContainer } from '
|
|
14
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
15
15
|
import Beneficiary from './Beneficiary';
|
|
16
16
|
import IBAN from './IBAN';
|
|
17
17
|
import BankName from './BankName';
|
|
18
|
-
import Button from '
|
|
19
|
-
import { useAppDispatch, useAppSelector } from '
|
|
18
|
+
import Button from '../../../shared/Button';
|
|
19
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
20
20
|
import { BankValidation } from './validation';
|
|
21
21
|
import { useTranslation } from 'react-i18next';
|
|
22
22
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
23
23
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
24
|
-
import { useLanguage } from '
|
|
24
|
+
import { useLanguage } from '../../../../hooks';
|
|
25
25
|
import { styled } from '@mui/material/styles';
|
|
26
|
-
import { bankSelector, createBankAccount } from '
|
|
27
|
-
import Form from '
|
|
28
|
-
import { handleCurrentActiveScreen } from '
|
|
26
|
+
import { bankSelector, createBankAccount } from '../../../app/bank/bankStore';
|
|
27
|
+
import Form from '../../../../components/Form';
|
|
28
|
+
import { handleCurrentActiveScreen } from '../../../../app/settings';
|
|
29
|
+
import ConfirmPolicy from './ConfirmPolicy';
|
|
29
30
|
var FormStyled = styled(Form)(function () { return ({
|
|
30
31
|
display: 'flex',
|
|
31
32
|
flexDirection: 'column',
|
|
@@ -52,9 +53,9 @@ var BankDetails = function () {
|
|
|
52
53
|
var t = useTranslation().t;
|
|
53
54
|
var isAr = useLanguage().isAr;
|
|
54
55
|
var onBack = function () {
|
|
55
|
-
dispatch(handleCurrentActiveScreen(''));
|
|
56
|
+
dispatch(handleCurrentActiveScreen('BANK_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
56
57
|
};
|
|
57
58
|
var disabled = ibanChecking || !methods.formState.isValid;
|
|
58
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, {}), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking }), _jsx(BankName, {}), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
59
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Beneficiary, {}), _jsx(IBAN, { fetchingIban: function (value) { return setIbanChecking(value); }, ibanChecking: ibanChecking }), _jsx(BankName, {}), _jsx(ConfirmPolicy, {}), _jsx(ButtonStyled, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('confirm') }))] })) })) }));
|
|
59
60
|
};
|
|
60
61
|
export default BankDetails;
|
|
@@ -11,17 +11,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { ScreenContainer } from '
|
|
15
|
-
import Input from '
|
|
14
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
15
|
+
import Input from '../../../shared/Input';
|
|
16
16
|
import { useTranslation } from 'react-i18next';
|
|
17
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
|
-
import ClearIcon from '
|
|
20
|
-
import CheckIcon from '
|
|
21
|
-
import { bankSelector } from '
|
|
22
|
-
import { useAppSelector } from '
|
|
23
|
-
import { removeAllOtherThanAlphabetAndSpace } from '
|
|
24
|
-
import Collapse from '
|
|
19
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
20
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
21
|
+
import { bankSelector } from '../../../app/bank/bankStore';
|
|
22
|
+
import { useAppSelector } from '../../../../hooks';
|
|
23
|
+
import { removeAllOtherThanAlphabetAndSpace } from '../../../../utils';
|
|
24
|
+
import Collapse from '../../../../components/Collapse';
|
|
25
25
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
26
26
|
var theme = _a.theme;
|
|
27
27
|
return ({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import Input from '
|
|
3
|
+
import Input from '../../../shared/Input';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useController, useFormContext } from 'react-hook-form';
|
|
6
6
|
import { styled } from '@mui/material';
|
|
7
|
-
import { removeOnlyNumbers } from '
|
|
8
|
-
import { ScreenContainer } from '
|
|
9
|
-
import { bankSelector } from '
|
|
10
|
-
import { useAppSelector, useLanguage } from '
|
|
11
|
-
import ClearIcon from '
|
|
12
|
-
import CheckIcon from '
|
|
7
|
+
import { removeOnlyNumbers } from '../../../../utils';
|
|
8
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
9
|
+
import { bankSelector } from '../../../app/bank/bankStore';
|
|
10
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
11
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
12
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
13
13
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
14
14
|
var theme = _a.theme;
|
|
15
15
|
return ({
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import { styled, alpha } from '@mui/material/styles';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import CheckBox from '../../../../components/CheckBox';
|
|
19
|
+
import Text from '../../../../components/Text';
|
|
20
|
+
import Warning from '../../../../components/Warning';
|
|
21
|
+
import Collapse from '../../../../components/Collapse';
|
|
22
|
+
var ConfirmContainerStyled = styled(Box)(function (_a) {
|
|
23
|
+
var theme = _a.theme;
|
|
24
|
+
return ({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'row',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
padding: theme.spacing(0, 2.5, 1.5, 2.5),
|
|
29
|
+
marginBlockStart: theme.spacing(3)
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
33
|
+
var theme = _a.theme;
|
|
34
|
+
return (__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre-line', height: 'fit-content' }, theme.typography.body2));
|
|
35
|
+
});
|
|
36
|
+
var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
37
|
+
var theme = _a.theme;
|
|
38
|
+
return ({
|
|
39
|
+
margin: theme.spacing(0),
|
|
40
|
+
padding: theme.spacing(0),
|
|
41
|
+
marginInlineEnd: theme.spacing(1.5),
|
|
42
|
+
color: theme.palette.primary.main,
|
|
43
|
+
'& .MuiSvgIcon-root': {
|
|
44
|
+
fontSize: theme.spacing(3.75)
|
|
45
|
+
},
|
|
46
|
+
'&.Mui-checked': {
|
|
47
|
+
color: theme.palette.text.primary,
|
|
48
|
+
borderRadius: theme.spacing(2.5)
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
var CollapseStyled = styled(Collapse)(function () { return ({
|
|
53
|
+
width: '100%'
|
|
54
|
+
}); });
|
|
55
|
+
var ConfirmPolicy = function () {
|
|
56
|
+
var _a;
|
|
57
|
+
var t = useTranslation().t;
|
|
58
|
+
var control = useFormContext().control;
|
|
59
|
+
var confirmControl = useController({ control: control, name: 'confirmPolicy' });
|
|
60
|
+
var confirmChecked = confirmControl.field.value;
|
|
61
|
+
var warningMessage = (_a = confirmControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
62
|
+
var handleConfirmCheckedChange = function (event, checked) {
|
|
63
|
+
confirmControl.field.onChange(checked);
|
|
64
|
+
};
|
|
65
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('bank_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
66
|
+
};
|
|
67
|
+
export default ConfirmPolicy;
|
|
@@ -36,19 +36,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
};
|
|
37
37
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
38
|
import * as React from 'react';
|
|
39
|
-
import Input from '
|
|
39
|
+
import Input from '../../../shared/Input';
|
|
40
40
|
import { useTranslation } from 'react-i18next';
|
|
41
41
|
import { useController, useFormContext } from 'react-hook-form';
|
|
42
|
-
import { removeAllOtherThanCharsAndNumber } from '
|
|
42
|
+
import { removeAllOtherThanCharsAndNumber } from '../../../../utils';
|
|
43
43
|
import { styled } from '@mui/material';
|
|
44
|
-
import { MAX_IBAN_VALUE } from '
|
|
45
|
-
import { ScreenContainer } from '
|
|
44
|
+
import { MAX_IBAN_VALUE } from '../../../../constants';
|
|
45
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
46
46
|
import { debounce } from 'lodash-es';
|
|
47
|
-
import { checkIbanBank } from '
|
|
48
|
-
import { useAppDispatch } from '
|
|
47
|
+
import { checkIbanBank } from '../../../app/bank/bankStore';
|
|
48
|
+
import { useAppDispatch } from '../../../../hooks';
|
|
49
49
|
import axios from 'axios';
|
|
50
|
-
import ClearIcon from '
|
|
51
|
-
import CheckIcon from '
|
|
50
|
+
import ClearIcon from '../../../shared/ClearIcon';
|
|
51
|
+
import CheckIcon from '../../../shared/CheckIcon';
|
|
52
52
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
53
53
|
var InputStyled = styled(Input)(function () { return ({
|
|
54
54
|
input: {
|
|
@@ -3,12 +3,15 @@ export declare const BankValidation: yup.ObjectSchema<import("yup/lib/object").A
|
|
|
3
3
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
4
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
5
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
6
7
|
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
8
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
8
9
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
9
10
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
10
12
|
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
11
13
|
iban: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
14
|
bankName: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
13
15
|
beneficiaryName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
16
|
+
confirmPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
|
|
14
17
|
}>>>;
|