|
1 | 1 | import React, {useMemo} from 'react'; |
2 | 2 | import {View} from 'react-native'; |
3 | | -import type {ViewStyle} from 'react-native'; |
| 3 | +import type {StyleProp, ViewStyle} from 'react-native'; |
4 | 4 | import type {ValueOf} from 'type-fest'; |
5 | 5 | import Checkbox from '@components/Checkbox'; |
6 | 6 | import type {TransactionWithOptionalHighlight} from '@components/MoneyRequestReportView/MoneyRequestReportTransactionList'; |
@@ -89,7 +89,7 @@ type TransactionItemRowProps = { |
89 | 89 | shouldShowCheckbox: boolean; |
90 | 90 | columns?: Array<ValueOf<typeof CONST.REPORT.TRANSACTION_LIST.COLUMNS>>; |
91 | 91 | onButtonPress?: () => void; |
92 | | - columnWrapperStyles?: ViewStyle[]; |
| 92 | + style?: StyleProp<ViewStyle>; |
93 | 93 | isReportItemChild?: boolean; |
94 | 94 | isActionLoading?: boolean; |
95 | 95 | isInSingleTransactionReport?: boolean; |
@@ -121,7 +121,7 @@ function TransactionItemRow({ |
121 | 121 | shouldShowCheckbox = false, |
122 | 122 | columns, |
123 | 123 | onButtonPress = () => {}, |
124 | | - columnWrapperStyles, |
| 124 | + style, |
125 | 125 | isReportItemChild = false, |
126 | 126 | isActionLoading, |
127 | 127 | isInSingleTransactionReport = false, |
@@ -360,14 +360,13 @@ function TransactionItemRow({ |
360 | 360 | transactionItem, |
361 | 361 | ], |
362 | 362 | ); |
363 | | - const safeColumnWrapperStyle = columnWrapperStyles ?? [styles.p3, styles.expenseWidgetRadius]; |
364 | 363 | const shouldRenderChatBubbleCell = useMemo(() => { |
365 | 364 | return columns?.includes(CONST.REPORT.TRANSACTION_LIST.COLUMNS.COMMENTS) ?? false; |
366 | 365 | }, [columns]); |
367 | 366 |
|
368 | 367 | if (shouldUseNarrowLayout) { |
369 | 368 | return ( |
370 | | - <View style={[styles.expenseWidgetRadius, styles.justifyContentEvenly, styles.p3, styles.pt2, bgActiveStyles]}> |
| 369 | + <View style={[styles.expenseWidgetRadius, styles.justifyContentEvenly, bgActiveStyles, style]}> |
371 | 370 | <View style={[styles.flexRow]}> |
372 | 371 | {shouldShowCheckbox && ( |
373 | 372 | <Checkbox |
@@ -460,7 +459,7 @@ function TransactionItemRow({ |
460 | 459 | } |
461 | 460 |
|
462 | 461 | return ( |
463 | | - <View style={[...safeColumnWrapperStyle, styles.flex1, styles.gap2, bgActiveStyles, styles.mw100]}> |
| 462 | + <View style={[styles.expenseWidgetRadius, styles.flex1, styles.gap2, bgActiveStyles, styles.mw100, style]}> |
464 | 463 | <View style={[styles.flex1, styles.flexRow, styles.alignItemsCenter, styles.gap3]}> |
465 | 464 | <Checkbox |
466 | 465 | disabled={isDisabled} |
|
0 commit comments