Skip to content

Commit 49e0760

Browse files
authored
Merge pull request Expensify#64584 from shubham1206agra/fix-corpay-wallet
Fixed account holder country having wrong value
2 parents 3cb926a + 57b228b commit 49e0760

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/pages/settings/Wallet/InternationalDepositAccount/substeps/AccountHolderInformation.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import AddressSearch from '@components/AddressSearch';
44
import FormProvider from '@components/Form/FormProvider';
55
import InputWrapper from '@components/Form/InputWrapper';
66
import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
7+
import PushRowWithModal from '@components/PushRowWithModal';
78
import TextInput from '@components/TextInput';
8-
import TextPicker from '@components/TextPicker';
99
import ValuePicker from '@components/ValuePicker';
1010
import useInternationalBankAccountFormSubmit from '@hooks/useInternationalBankAccountFormSubmit';
1111
import useLocalize from '@hooks/useLocalize';
@@ -14,7 +14,6 @@ import type CustomSubStepProps from '@pages/settings/Wallet/InternationalDeposit
1414
import {getValidationErrors} from '@pages/settings/Wallet/InternationalDepositAccount/utils';
1515
import Text from '@src/components/Text';
1616
import CONST from '@src/CONST';
17-
import type {TranslationPaths} from '@src/languages/types';
1817
import ONYXKEYS from '@src/ONYXKEYS';
1918
import type {CorpayFormField} from '@src/types/onyx';
2019
import {isEmptyObject} from '@src/types/utils/EmptyObject';
@@ -30,7 +29,7 @@ function getInputComponent(field: CorpayFormField) {
3029
return AddressSearch;
3130
}
3231
if (field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY) {
33-
return TextPicker;
32+
return PushRowWithModal;
3433
}
3534
return TextInput;
3635
}
@@ -104,9 +103,9 @@ function AccountHolderInformation({isEditing, onNext, formValues, fieldsMap}: Cu
104103
label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)}
105104
description={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? field.label : undefined}
106105
items={getItems(field)}
107-
disabled={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY}
108-
interactive={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined}
109-
value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? translate(`allCountries.${formValues.bankCountry}` as TranslationPaths) : undefined}
106+
shouldAllowChange={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined}
107+
optionsList={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? CONST.ALL_COUNTRIES : undefined}
108+
value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? formValues.bankCountry : undefined}
110109
shouldSaveDraft={!isEditing}
111110
renamedInputKeys={{
112111
street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.STEPS_NAME.ACCOUNT_HOLDER_INFORMATION]?.accountHolderAddress1) ? '' : 'accountHolderAddress1',

0 commit comments

Comments
 (0)