@tap-payments/auth-jsconnect 2.0.103-test → 2.0.104-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.
|
@@ -330,9 +330,9 @@ export var bankSlice = createSlice({
|
|
|
330
330
|
}
|
|
331
331
|
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
332
332
|
state.data.verify.token = token;
|
|
333
|
-
state.data.bankData.bankName = (_b = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _b === void 0 ? void 0 : _b.bank_name;
|
|
334
|
-
state.data.bankData.beneficiaryName = (_c = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _c === void 0 ? void 0 : _c.beneficiary_name;
|
|
335
|
-
state.data.bankData.iban = (_d = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _d === void 0 ? void 0 : _d.iban;
|
|
333
|
+
state.data.bankData.bankName = ((_b = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _b === void 0 ? void 0 : _b.bank_name) || '';
|
|
334
|
+
state.data.bankData.beneficiaryName = ((_c = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _c === void 0 ? void 0 : _c.beneficiary_name) || '';
|
|
335
|
+
state.data.bankData.iban = ((_d = boardResponse === null || boardResponse === void 0 ? void 0 : boardResponse.bank_account) === null || _d === void 0 ? void 0 : _d.iban) || '';
|
|
336
336
|
})
|
|
337
337
|
.addCase(verifyLeadToken.rejected, function (state, action) {
|
|
338
338
|
state.error = action.error.message;
|
|
@@ -4,10 +4,10 @@ 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 {
|
|
7
|
+
import { removeArabicWords } from '../../../../utils';
|
|
8
8
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
9
9
|
import { bankSelector } from '../../../app/bank/bankStore';
|
|
10
|
-
import { useAppSelector
|
|
10
|
+
import { useAppSelector } from '../../../../hooks';
|
|
11
11
|
import ClearIcon from '../../../shared/ClearIcon';
|
|
12
12
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
13
13
|
var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
@@ -28,24 +28,20 @@ var Beneficiary = function () {
|
|
|
28
28
|
var _a, _b;
|
|
29
29
|
var t = useTranslation().t;
|
|
30
30
|
var _c = useFormContext(), setValue = _c.setValue, control = _c.control;
|
|
31
|
-
var isAr = useLanguage().isAr;
|
|
32
31
|
var data = useAppSelector(bankSelector).data;
|
|
33
32
|
var beneficiaryControl = useController({ name: 'beneficiaryName', control: control });
|
|
34
33
|
var beneficiaryValue = beneficiaryControl.field.value;
|
|
35
34
|
var hasError = (_a = beneficiaryControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
36
35
|
var error = (_b = beneficiaryControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
37
|
-
var
|
|
38
|
-
var legalName = (entity === null || entity === void 0 ? void 0 : entity.legal_name) || {};
|
|
36
|
+
var bank_account = (data.verify.responseBody || {}).bank_account;
|
|
39
37
|
React.useEffect(function () {
|
|
40
38
|
var beneficiary_name = (bank_account || {}).beneficiary_name;
|
|
41
39
|
if (beneficiary_name)
|
|
42
40
|
setValue('beneficiaryName', beneficiary_name);
|
|
43
|
-
else
|
|
44
|
-
setValue('beneficiaryName', isAr ? legalName === null || legalName === void 0 ? void 0 : legalName.ar : legalName === null || legalName === void 0 ? void 0 : legalName.en);
|
|
45
41
|
}, []);
|
|
46
42
|
var handleBeneficiaryChange = function (_a) {
|
|
47
43
|
var target = _a.target;
|
|
48
|
-
var value =
|
|
44
|
+
var value = removeArabicWords(target.value);
|
|
49
45
|
beneficiaryControl.field.onChange(value);
|
|
50
46
|
};
|
|
51
47
|
var clearValue = function () {
|
|
@@ -13,3 +13,4 @@ export declare function isPasswordHasLowerLetter(password: string): boolean;
|
|
|
13
13
|
export declare function isPasswordHasSpecialLetter(password: string): boolean;
|
|
14
14
|
export declare const keepLettersAndSpace: (str: string) => string;
|
|
15
15
|
export declare const isTapDomain: (domain: string) => boolean;
|
|
16
|
+
export declare const removeArabicWords: (str: string) => string;
|