@@ -61,6 +61,7 @@ import type * as OnyxTypes from '@src/types/onyx';
6161import type { Attendee , Participant } from '@src/types/onyx/IOU' ;
6262import type { PaymentMethodType } from '@src/types/onyx/OriginalMessage' ;
6363import type { SplitShares } from '@src/types/onyx/Transaction' ;
64+ import Button from './Button' ;
6465import ButtonWithDropdownMenu from './ButtonWithDropdownMenu' ;
6566import type { DropdownOption } from './ButtonWithDropdownMenu/types' ;
6667import FormHelpMessage from './FormHelpMessage' ;
@@ -183,6 +184,9 @@ type MoneyRequestConfirmationListProps = {
183184
184185 /** The PDF password callback */
185186 onPDFPassword ?: ( ) => void ;
187+
188+ /** Show remove expense confirmation modal */
189+ showRemoveExpenseConfirmModal ?: ( ) => void ;
186190} ;
187191
188192type MoneyRequestConfirmationListItem = Participant | OptionData ;
@@ -224,6 +228,7 @@ function MoneyRequestConfirmationList({
224228 isConfirming,
225229 onPDFLoadError,
226230 onPDFPassword,
231+ showRemoveExpenseConfirmModal,
227232} : MoneyRequestConfirmationListProps ) {
228233 const [ policyCategoriesReal ] = useOnyx ( `${ ONYXKEYS . COLLECTION . POLICY_CATEGORIES } ${ policyID } ` , { canBeMissing : true } ) ;
229234 const [ policyTags ] = useOnyx ( `${ ONYXKEYS . COLLECTION . POLICY_TAGS } ${ policyID } ` , { canBeMissing : true } ) ;
@@ -1004,16 +1009,26 @@ function MoneyRequestConfirmationList({
10041009 isLoading = { isConfirmed || isConfirming }
10051010 />
10061011 ) : (
1007- < ButtonWithDropdownMenu
1008- pressOnEnter
1009- onPress = { ( event , value ) => confirm ( value as PaymentMethodType ) }
1010- options = { splitOrRequestOptions }
1011- buttonSize = { CONST . DROPDOWN_BUTTON_SIZE . LARGE }
1012- enterKeyEventListenerPriority = { 1 }
1013- useKeyboardShortcuts
1014- // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
1015- isLoading = { isConfirmed || isConfirming }
1016- />
1012+ < >
1013+ { expensesNumber > 1 && (
1014+ < Button
1015+ large
1016+ text = { translate ( 'iou.removeThisExpense' ) }
1017+ onPress = { showRemoveExpenseConfirmModal }
1018+ style = { styles . mb3 }
1019+ />
1020+ ) }
1021+ < ButtonWithDropdownMenu
1022+ pressOnEnter
1023+ onPress = { ( event , value ) => confirm ( value as PaymentMethodType ) }
1024+ options = { splitOrRequestOptions }
1025+ buttonSize = { CONST . DROPDOWN_BUTTON_SIZE . LARGE }
1026+ enterKeyEventListenerPriority = { 1 }
1027+ useKeyboardShortcuts
1028+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
1029+ isLoading = { isConfirmed || isConfirming }
1030+ />
1031+ </ >
10171032 ) ;
10181033
10191034 return (
@@ -1051,6 +1066,10 @@ function MoneyRequestConfirmationList({
10511066 isConfirmed ,
10521067 splitOrRequestOptions ,
10531068 errorMessage ,
1069+ expensesNumber ,
1070+ translate ,
1071+ showRemoveExpenseConfirmModal ,
1072+ styles . mb3 ,
10541073 styles . ph1 ,
10551074 styles . mb2 ,
10561075 styles . productTrainingTooltipWrapper ,
0 commit comments