@@ -554,84 +554,101 @@ function MoneyRequestReportTransactionList({
554554 [ groupByOptions , reportLayoutGroupBy , styles , windowHeight , isInLandscapeMode ] ,
555555 ) ;
556556
557+ const lastTransactionID = useMemo ( ( ) => {
558+ const allTransactions = shouldShowGroupedTransactions ? groupedTransactions . flatMap ( ( group ) => group . transactions ) : resolvedTransactions ;
559+ const nonDeletedTransactions = allTransactions . filter ( ( t ) => ! isTransactionPendingDelete ( t ) ) ;
560+ return nonDeletedTransactions . at ( - 1 ) ?. transactionID ;
561+ } , [ shouldShowGroupedTransactions , groupedTransactions , resolvedTransactions ] ) ;
562+
563+ const transactionItems = shouldShowGroupedTransactions
564+ ? groupedTransactions . map ( ( group ) => {
565+ const selectionState = groupSelectionState . get ( group . groupKey ) ?? {
566+ isSelected : false ,
567+ isIndeterminate : false ,
568+ isDisabled : false ,
569+ pendingAction : undefined ,
570+ } ;
571+
572+ return (
573+ < View
574+ key = { group . groupKey }
575+ style = { ! shouldUseNarrowLayout && styles . gap2 }
576+ >
577+ < MoneyRequestReportGroupHeader
578+ group = { group }
579+ groupKey = { group . groupKey }
580+ currency = { report ?. currency ?? '' }
581+ isGroupedByTag = { currentGroupBy === CONST . REPORT_LAYOUT . GROUP_BY . TAG }
582+ isSelectionModeEnabled = { isMobileSelectionModeEnabled }
583+ isSelected = { selectionState . isSelected }
584+ isIndeterminate = { selectionState . isIndeterminate }
585+ isDisabled = { selectionState . isDisabled }
586+ onToggleSelection = { toggleGroupSelection }
587+ pendingAction = { selectionState . pendingAction }
588+ shouldUseNarrowLayout = { shouldUseNarrowLayout }
589+ />
590+ { group . transactions . map ( ( transaction ) => {
591+ const isLastItem = transaction . transactionID === lastTransactionID ;
592+ return (
593+ < MoneyRequestReportTransactionItem
594+ key = { transaction . transactionID }
595+ transaction = { transaction }
596+ shouldBeHighlighted = { highlightedTransactionIDs . has ( transaction . transactionID ) }
597+ columns = { columnsToShow }
598+ report = { report }
599+ policy = { policy }
600+ isSelectionModeEnabled = { isMobileSelectionModeEnabled }
601+ toggleTransaction = { toggleTransaction }
602+ isSelected = { isTransactionSelected ( transaction . transactionID ) }
603+ handleOnPress = { handleOnPress }
604+ handleLongPress = { handleLongPress }
605+ dateColumnSize = { dateColumnSize }
606+ amountColumnSize = { amountColumnSize }
607+ taxAmountColumnSize = { taxAmountColumnSize }
608+ scrollToNewTransaction = { transaction . transactionID === newTransactions ?. at ( 0 ) ?. transactionID ? scrollToNewTransaction : undefined }
609+ onArrowRightPress = { handleArrowRightPress }
610+ nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards ?? { } }
611+ isLastItem = { isLastItem }
612+ />
613+ ) ;
614+ } ) }
615+ </ View >
616+ ) ;
617+ } )
618+ : resolvedTransactions . map ( ( transaction ) => {
619+ const isLastItem = transaction . transactionID === lastTransactionID ;
620+ return (
621+ < MoneyRequestReportTransactionItem
622+ key = { transaction . transactionID }
623+ transaction = { transaction }
624+ shouldBeHighlighted = { highlightedTransactionIDs . has ( transaction . transactionID ) }
625+ columns = { columnsToShow }
626+ report = { report }
627+ policy = { policy }
628+ isSelectionModeEnabled = { isMobileSelectionModeEnabled }
629+ toggleTransaction = { toggleTransaction }
630+ isSelected = { isTransactionSelected ( transaction . transactionID ) }
631+ handleOnPress = { handleOnPress }
632+ handleLongPress = { handleLongPress }
633+ dateColumnSize = { dateColumnSize }
634+ amountColumnSize = { amountColumnSize }
635+ taxAmountColumnSize = { taxAmountColumnSize }
636+ scrollToNewTransaction = { transaction . transactionID === newTransactions ?. at ( 0 ) ?. transactionID ? scrollToNewTransaction : undefined }
637+ onArrowRightPress = { handleArrowRightPress }
638+ nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards ?? { } }
639+ isLastItem = { isLastItem }
640+ />
641+ ) ;
642+ } ) ;
643+
644+ const narrowListWrapper = shouldUseNarrowLayout ? [ styles . highlightBG , styles . searchTableTopRadius , styles . searchTableBottomRadius , styles . overflowHidden ] : undefined ;
645+
557646 const transactionListContent = (
558647 < View
559- style = { [ listHorizontalPadding , styles . gap2 , styles . pb4 , styles . mb2 ] }
648+ style = { [ listHorizontalPadding , ! shouldUseNarrowLayout && styles . gap2 , shouldUseNarrowLayout ? styles . pb2 : styles . pb4 , ! shouldUseNarrowLayout && styles . mb2 ] }
560649 onLayout = { onLayout }
561650 >
562- { shouldShowGroupedTransactions
563- ? groupedTransactions . map ( ( group ) => {
564- const selectionState = groupSelectionState . get ( group . groupKey ) ?? {
565- isSelected : false ,
566- isIndeterminate : false ,
567- isDisabled : false ,
568- pendingAction : undefined ,
569- } ;
570-
571- return (
572- < View
573- key = { group . groupKey }
574- style = { styles . gap2 }
575- >
576- < MoneyRequestReportGroupHeader
577- group = { group }
578- groupKey = { group . groupKey }
579- currency = { report ?. currency ?? '' }
580- isGroupedByTag = { currentGroupBy === CONST . REPORT_LAYOUT . GROUP_BY . TAG }
581- isSelectionModeEnabled = { isMobileSelectionModeEnabled }
582- isSelected = { selectionState . isSelected }
583- isIndeterminate = { selectionState . isIndeterminate }
584- isDisabled = { selectionState . isDisabled }
585- onToggleSelection = { toggleGroupSelection }
586- pendingAction = { selectionState . pendingAction }
587- />
588- { group . transactions . map ( ( transaction ) => {
589- return (
590- < MoneyRequestReportTransactionItem
591- key = { transaction . transactionID }
592- transaction = { transaction }
593- shouldBeHighlighted = { highlightedTransactionIDs . has ( transaction . transactionID ) }
594- columns = { columnsToShow }
595- report = { report }
596- policy = { policy }
597- isSelectionModeEnabled = { isMobileSelectionModeEnabled }
598- toggleTransaction = { toggleTransaction }
599- isSelected = { isTransactionSelected ( transaction . transactionID ) }
600- handleOnPress = { handleOnPress }
601- handleLongPress = { handleLongPress }
602- dateColumnSize = { dateColumnSize }
603- amountColumnSize = { amountColumnSize }
604- taxAmountColumnSize = { taxAmountColumnSize }
605- scrollToNewTransaction = { transaction . transactionID === newTransactions ?. at ( 0 ) ?. transactionID ? scrollToNewTransaction : undefined }
606- onArrowRightPress = { handleArrowRightPress }
607- nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards ?? { } }
608- />
609- ) ;
610- } ) }
611- </ View >
612- ) ;
613- } )
614- : resolvedTransactions . map ( ( transaction ) => (
615- < MoneyRequestReportTransactionItem
616- key = { transaction . transactionID }
617- transaction = { transaction }
618- shouldBeHighlighted = { highlightedTransactionIDs . has ( transaction . transactionID ) }
619- columns = { columnsToShow }
620- report = { report }
621- policy = { policy }
622- isSelectionModeEnabled = { isMobileSelectionModeEnabled }
623- toggleTransaction = { toggleTransaction }
624- isSelected = { isTransactionSelected ( transaction . transactionID ) }
625- handleOnPress = { handleOnPress }
626- handleLongPress = { handleLongPress }
627- dateColumnSize = { dateColumnSize }
628- amountColumnSize = { amountColumnSize }
629- taxAmountColumnSize = { taxAmountColumnSize }
630- scrollToNewTransaction = { transaction . transactionID === newTransactions ?. at ( 0 ) ?. transactionID ? scrollToNewTransaction : undefined }
631- onArrowRightPress = { handleArrowRightPress }
632- nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards ?? { } }
633- />
634- ) ) }
651+ { narrowListWrapper ? < View style = { narrowListWrapper } > { transactionItems } </ View > : transactionItems }
635652 { showPendingExpensePlaceholder && (
636653 < SearchRowSkeleton
637654 shouldAnimate
@@ -706,7 +723,7 @@ function MoneyRequestReportTransactionList({
706723
707724 return (
708725 < >
709- < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . ph5 , styles . pb2 ] } >
726+ < View style = { [ styles . flexRow , styles . gap2 , styles . alignItemsCenter , styles . ph5 , shouldUseNarrowLayout ? styles . pb3 : styles . pb2 ] } >
710727 { shouldShowGroupedTransactions && (
711728 < DropdownButton
712729 label = { translate ( 'search.display.groupBy' ) }
0 commit comments