Skip to content

Commit

Permalink
Merge pull request Expensify#51234 from cretadn22/disable-bank-accoun…
Browse files Browse the repository at this point in the history
…t-and-routing-number

Disable bank account and routing number
  • Loading branch information
mountiny authored Oct 23, 2024
2 parents 55d4cca + ebba967 commit f251dbc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pages/ReimbursementAccount/BankInfo/substeps/Manual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function Manual({onNext}: ManualProps) {
[BANK_INFO_STEP_KEYS.ACCOUNT_NUMBER]: reimbursementAccount?.achData?.[BANK_INFO_STEP_KEYS.ACCOUNT_NUMBER] ?? '',
};

const shouldBeReadOnlyInput = reimbursementAccount?.achData?.setupType === CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID;
const hasBankAccountData = !!(reimbursementAccount?.achData?.bankAccountID ?? '');

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM>): FormInputErrors<typeof ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM> => {
Expand All @@ -58,8 +58,6 @@ function Manual({onNext}: ManualProps) {
[translate],
);

const hasBankAccountData = !!(reimbursementAccount?.achData?.bankAccountID ?? '');

const handleSubmit = useReimbursementAccountStepFormSubmit({
fieldIds: STEP_FIELDS,
onNext,
Expand Down Expand Up @@ -88,7 +86,7 @@ function Manual({onNext}: ManualProps) {
inputMode={CONST.INPUT_MODE.NUMERIC}
shouldSaveDraft
shouldUseDefaultValue={hasBankAccountData}
disabled={shouldBeReadOnlyInput}
disabled={hasBankAccountData}
/>
<InputWrapper
InputComponent={TextInput}
Expand All @@ -101,7 +99,7 @@ function Manual({onNext}: ManualProps) {
inputMode={CONST.INPUT_MODE.NUMERIC}
shouldSaveDraft
shouldUseDefaultValue={hasBankAccountData}
disabled={shouldBeReadOnlyInput}
disabled={hasBankAccountData}
/>
</FormProvider>
);
Expand Down

0 comments on commit f251dbc

Please sign in to comment.