From 22e79214dbad3f0ca172178714620e17810800e0 Mon Sep 17 00:00:00 2001 From: Yauheni Pasiukevich Date: Wed, 6 Nov 2024 13:46:49 +0100 Subject: [PATCH] feat: add upload field to the confirmation screen --- .../NonUSD/BankInfo/substeps/Confirmation.tsx | 46 ++++++++++++------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/src/pages/ReimbursementAccount/NonUSD/BankInfo/substeps/Confirmation.tsx b/src/pages/ReimbursementAccount/NonUSD/BankInfo/substeps/Confirmation.tsx index c336d33d2d79..d8c93b6a82c8 100644 --- a/src/pages/ReimbursementAccount/NonUSD/BankInfo/substeps/Confirmation.tsx +++ b/src/pages/ReimbursementAccount/NonUSD/BankInfo/substeps/Confirmation.tsx @@ -13,6 +13,7 @@ import getSubstepValues from '@pages/ReimbursementAccount/utils/getSubstepValues import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {ReimbursementAccountForm} from '@src/types/form/ReimbursementAccountForm'; +import INPUT_IDS from '@src/types/form/ReimbursementAccountForm'; function Confirmation({onNext, onMove, corpayFields}: BankInfoSubStepProps) { const {translate} = useLocalize(); @@ -30,26 +31,37 @@ function Confirmation({onNext, onMove, corpayFields}: BankInfoSubStepProps) { const values = useMemo(() => getSubstepValues(inputKeys, reimbursementAccountDraft, reimbursementAccount), [inputKeys, reimbursementAccount, reimbursementAccountDraft]); const items = useMemo( - () => - corpayFields.map((field) => { - return ( + () => ( + <> + {corpayFields.map((field) => { + return ( + { + if (field.id.includes(CONST.NON_USD_BANK_ACCOUNT.BANK_INFO_STEP_ACCOUNT_HOLDER_KEY_PREFIX)) { + onMove(1); + return; + } + + onMove(0); + }} + key={field.id} + /> + ); + })} + {reimbursementAccountDraft?.[INPUT_IDS.ADDITIONAL_DATA.CORPAY.BANK_STATEMENT] && ( file.name).join(', ')} shouldShowRightIcon - onPress={() => { - if (field.id.includes(CONST.NON_USD_BANK_ACCOUNT.BANK_INFO_STEP_ACCOUNT_HOLDER_KEY_PREFIX)) { - onMove(1); - return; - } - - onMove(0); - }} - key={field.id} + onPress={() => onMove(2)} /> - ); - }), - [corpayFields, onMove, values], + )} + + ), + [corpayFields, onMove, reimbursementAccountDraft, translate, values], ); return (