From 57b228b2f6fbc5a57899026561a3ccd72f23ca26 Mon Sep 17 00:00:00 2001 From: Shubham Agrawal Date: Thu, 19 Jun 2025 21:38:35 +0530 Subject: [PATCH] Fixed account holder country having wrong value --- .../substeps/AccountHolderInformation.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/pages/settings/Wallet/InternationalDepositAccount/substeps/AccountHolderInformation.tsx b/src/pages/settings/Wallet/InternationalDepositAccount/substeps/AccountHolderInformation.tsx index c80b25ba1225..2767b8237f78 100644 --- a/src/pages/settings/Wallet/InternationalDepositAccount/substeps/AccountHolderInformation.tsx +++ b/src/pages/settings/Wallet/InternationalDepositAccount/substeps/AccountHolderInformation.tsx @@ -4,8 +4,8 @@ import AddressSearch from '@components/AddressSearch'; import FormProvider from '@components/Form/FormProvider'; import InputWrapper from '@components/Form/InputWrapper'; import type {FormInputErrors, FormOnyxValues} from '@components/Form/types'; +import PushRowWithModal from '@components/PushRowWithModal'; import TextInput from '@components/TextInput'; -import TextPicker from '@components/TextPicker'; import ValuePicker from '@components/ValuePicker'; import useInternationalBankAccountFormSubmit from '@hooks/useInternationalBankAccountFormSubmit'; import useLocalize from '@hooks/useLocalize'; @@ -14,7 +14,6 @@ import type CustomSubStepProps from '@pages/settings/Wallet/InternationalDeposit import {getValidationErrors} from '@pages/settings/Wallet/InternationalDepositAccount/utils'; import Text from '@src/components/Text'; import CONST from '@src/CONST'; -import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type {CorpayFormField} from '@src/types/onyx'; import {isEmptyObject} from '@src/types/utils/EmptyObject'; @@ -30,7 +29,7 @@ function getInputComponent(field: CorpayFormField) { return AddressSearch; } if (field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY) { - return TextPicker; + return PushRowWithModal; } return TextInput; } @@ -104,9 +103,9 @@ function AccountHolderInformation({isEditing, onNext, formValues, fieldsMap}: Cu label={field.label + (field.isRequired ? '' : ` (${translate('common.optional')})`)} description={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? field.label : undefined} items={getItems(field)} - disabled={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY} - interactive={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined} - value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? translate(`allCountries.${formValues.bankCountry}` as TranslationPaths) : undefined} + shouldAllowChange={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? false : undefined} + optionsList={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? CONST.ALL_COUNTRIES : undefined} + value={field.id === CONST.CORPAY_FIELDS.ACCOUNT_HOLDER_COUNTRY_KEY ? formValues.bankCountry : undefined} shouldSaveDraft={!isEditing} renamedInputKeys={{ street: isEmptyObject(fieldsMap[CONST.CORPAY_FIELDS.STEPS_NAME.ACCOUNT_HOLDER_INFORMATION]?.accountHolderAddress1) ? '' : 'accountHolderAddress1',