@@ -10,6 +10,7 @@ import useAnimatedHighlightStyle from '@hooks/useAnimatedHighlightStyle';
1010import useLocalize from '@hooks/useLocalize' ;
1111import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
1212import useResponsiveLayoutOnWideRHP from '@hooks/useResponsiveLayoutOnWideRHP' ;
13+ import useStyleUtils from '@hooks/useStyleUtils' ;
1314import useTheme from '@hooks/useTheme' ;
1415import useThemeStyles from '@hooks/useThemeStyles' ;
1516import useTransactionViolations from '@hooks/useTransactionViolations' ;
@@ -70,8 +71,11 @@ type MoneyRequestReportTransactionItemProps = {
7071 /** List of cards for the user */
7172 nonPersonalAndWorkspaceCards : CardList ;
7273
73- /** Whether this is the last item in the list (used to skip border-bottom on narrow) */
74+ /** Whether this is the last item in the list */
7475 isLastItem ?: boolean ;
76+
77+ /** Whether the list is horizontally scrollable */
78+ shouldScrollHorizontally ?: boolean ;
7579} ;
7680
7781function MoneyRequestReportTransactionItem ( {
@@ -92,9 +96,11 @@ function MoneyRequestReportTransactionItem({
9296 shouldBeHighlighted,
9397 nonPersonalAndWorkspaceCards,
9498 isLastItem = false ,
99+ shouldScrollHorizontally = false ,
95100} : MoneyRequestReportTransactionItemProps ) {
96101 const { translate} = useLocalize ( ) ;
97102 const styles = useThemeStyles ( ) ;
103+ const StyleUtils = useStyleUtils ( ) ;
98104 // eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
99105 const { isSmallScreenWidth, isMediumScreenWidth} = useResponsiveLayout ( ) ;
100106 const { shouldUseNarrowLayout} = useResponsiveLayoutOnWideRHP ( ) ;
@@ -117,15 +123,18 @@ function MoneyRequestReportTransactionItem({
117123 } , [ scrollToNewTransaction , shouldBeHighlighted ] ) ;
118124
119125 const animatedHighlightStyle = useAnimatedHighlightStyle ( {
120- borderRadius : shouldUseNarrowLayout ? 0 : variables . componentBorderRadius ,
126+ borderRadius : shouldUseNarrowLayout ? variables . componentBorderRadius : 0 ,
121127 shouldHighlight : shouldBeHighlighted ,
122128 highlightColor : theme . messageHighlightBG ,
123129 backgroundColor : theme . highlightBG ,
124130 shouldApplyOtherStyles : ! shouldUseNarrowLayout ,
125131 } ) ;
126132
127133 return (
128- < OfflineWithFeedback pendingAction = { pendingAction } >
134+ < OfflineWithFeedback
135+ pendingAction = { pendingAction }
136+ style = { ! shouldUseNarrowLayout && isLastItem && [ styles . searchTableBottomRadius , styles . overflowHidden ] }
137+ >
129138 < PressableWithFeedback
130139 key = { transaction . transactionID }
131140 onPress = { ( ) => {
@@ -136,7 +145,7 @@ function MoneyRequestReportTransactionItem({
136145 role = { getButtonRole ( true ) }
137146 isNested
138147 id = { transaction . transactionID }
139- style = { [ styles . transactionListItemStyle , shouldUseNarrowLayout && styles . noBorderRadius ] }
148+ style = { [ styles . transactionListItemStyle , ! shouldUseNarrowLayout ? StyleUtils . getSearchTableRowPressableStyle ( isLastItem , isSelected ) : styles . noBorderRadius ] }
140149 hoverStyle = { [ ! isPendingDelete && styles . hoveredComponentBG , isSelected && styles . activeComponentBG ] }
141150 dataSet = { { [ CONST . SELECTION_SCRAPER_HIDDEN_ELEMENT ] : true } }
142151 onPressIn = { ( ) => canUseTouchScreen ( ) && ControlSelection . block ( ) }
@@ -146,7 +155,7 @@ function MoneyRequestReportTransactionItem({
146155 } }
147156 disabled = { isTransactionPendingDelete ( transaction ) }
148157 ref = { viewRef }
149- wrapperStyle = { [ animatedHighlightStyle , styles . userSelectNone , shouldUseNarrowLayout && ! isLastItem && styles . borderBottom ] }
158+ wrapperStyle = { [ animatedHighlightStyle , styles . userSelectNone , shouldUseNarrowLayout && ! isLastItem && StyleUtils . getSelectedBorderBottomStyle ( isSelected ) ] }
150159 >
151160 { ( { hovered} ) => (
152161 < TransactionItemRow
@@ -159,18 +168,19 @@ function MoneyRequestReportTransactionItem({
159168 amountColumnSize = { amountColumnSize }
160169 taxAmountColumnSize = { taxAmountColumnSize }
161170 shouldShowTooltip
162- shouldUseNarrowLayout = { shouldUseNarrowLayout || isMediumScreenWidth }
171+ shouldUseNarrowLayout = { shouldUseNarrowLayout || ( isMediumScreenWidth && ! shouldScrollHorizontally ) }
163172 shouldShowCheckbox = { ! ! isSelectionModeEnabled || ! isSmallScreenWidth }
164173 onCheckboxPress = { toggleTransaction }
165174 columns = { columns }
166175 isDisabled = { isPendingDelete }
167- style = { shouldUseNarrowLayout ? [ styles . p4 , styles . noBorderRadius ] : [ styles . p3 ] }
176+ style = { ! shouldUseNarrowLayout ? [ styles . p3 , styles . pv2 , styles . noBorderRadius ] : [ styles . p4 , styles . noBorderRadius ] }
168177 onButtonPress = { ( ) => {
169178 handleOnPress ( transaction . transactionID ) ;
170179 } }
171180 onArrowRightPress = { ( ) => onArrowRightPress ?.( transaction . transactionID ) }
172181 isHover = { hovered }
173182 nonPersonalAndWorkspaceCards = { nonPersonalAndWorkspaceCards }
183+ shouldRemoveTotalColumnFlex
174184 />
175185 ) }
176186 </ PressableWithFeedback >
0 commit comments