|
1 | 1 | import React from 'react'; |
| 2 | +import {View} from 'react-native'; |
2 | 3 | import type {OnyxEntry} from 'react-native-onyx'; |
3 | 4 | import {getButtonRole} from '@components/Button/utils'; |
4 | 5 | import OfflineWithFeedback from '@components/OfflineWithFeedback'; |
5 | 6 | import {usePersonalDetails} from '@components/OnyxListItemProvider'; |
6 | 7 | import {PressableWithFeedback} from '@components/Pressable'; |
| 8 | +import RadioButton from '@components/RadioButton'; |
7 | 9 | import type {ExpenseReportListItemType, TransactionListItemType} from '@components/Search/SearchList/ListItem/types'; |
8 | 10 | import UserInfoAndActionButtonRow from '@components/Search/SearchList/ListItem/UserInfoAndActionButtonRow'; |
9 | 11 | import TransactionItemRow from '@components/TransactionItemRow'; |
10 | 12 | import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails'; |
11 | 13 | import useOnyx from '@hooks/useOnyx'; |
12 | 14 | import useThemeStyles from '@hooks/useThemeStyles'; |
13 | 15 | import {getOriginalMessage, isMoneyRequestAction} from '@libs/ReportActionsUtils'; |
14 | | -import variables from '@styles/variables'; |
15 | 16 | import {createTransactionThreadReport} from '@userActions/Report'; |
16 | 17 | import CONST from '@src/CONST'; |
17 | 18 | import ONYXKEYS from '@src/ONYXKEYS'; |
@@ -89,36 +90,46 @@ function DuplicateTransactionItem({transaction, isLastItem, isSelected, shouldSh |
89 | 90 | role={getButtonRole(true)} |
90 | 91 | isNested |
91 | 92 | hoverStyle={styles.hoveredComponentBG} |
92 | | - style={[!isLastItem && styles.borderBottom, styles.pt4, styles.pb4, styles.pl4, shouldShowSelection ? styles.pr0 : styles.pr4]} |
| 93 | + style={[!isLastItem && styles.borderBottom, styles.pt4, styles.pb4, styles.pl4, styles.pr4]} |
93 | 94 | > |
94 | | - {!!reportStatusItem && ( |
95 | | - <UserInfoAndActionButtonRow |
96 | | - item={reportStatusItem} |
97 | | - shouldShowUserInfo |
98 | | - stateNum={report?.stateNum} |
99 | | - statusNum={report?.statusNum} |
100 | | - containerStyles={[styles.mb3, shouldShowSelection && styles.pr4]} |
101 | | - /> |
102 | | - )} |
103 | | - <TransactionItemRow |
104 | | - transactionItem={transaction as TransactionListItemType} |
105 | | - report={report} |
106 | | - policy={policy} |
107 | | - shouldUseNarrowLayout |
108 | | - isSelected={isSelected} |
109 | | - shouldShowTooltip={false} |
110 | | - dateColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
111 | | - amountColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
112 | | - taxAmountColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
113 | | - shouldHighlightItemWhenSelected={false} |
114 | | - shouldShowErrors={false} |
115 | | - style={shouldShowSelection ? [styles.pr0] : [styles.pv2]} |
116 | | - shouldShowRadioButton={shouldShowSelection} |
117 | | - shouldStopRadioButtonMouseDownPropagation |
118 | | - radioButtonContainerStyle={styles.ml0} |
119 | | - radioButtonWrapperStyle={[styles.justifyContentCenter, styles.pr3half, {paddingLeft: 10, height: variables.w44}]} |
120 | | - onRadioButtonPress={() => onSelectTransaction(transaction.transactionID)} |
121 | | - /> |
| 95 | + <View style={styles.flexRow}> |
| 96 | + <View style={[styles.flex1, shouldShowSelection && styles.mr3]}> |
| 97 | + {!!reportStatusItem && ( |
| 98 | + <UserInfoAndActionButtonRow |
| 99 | + item={reportStatusItem} |
| 100 | + shouldShowUserInfo |
| 101 | + stateNum={report?.stateNum} |
| 102 | + statusNum={report?.statusNum} |
| 103 | + containerStyles={styles.mb3} |
| 104 | + /> |
| 105 | + )} |
| 106 | + <TransactionItemRow |
| 107 | + transactionItem={transaction as TransactionListItemType} |
| 108 | + report={report} |
| 109 | + policy={policy} |
| 110 | + shouldUseNarrowLayout |
| 111 | + isSelected={isSelected} |
| 112 | + shouldShowTooltip={false} |
| 113 | + dateColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
| 114 | + amountColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
| 115 | + taxAmountColumnSize={CONST.SEARCH.TABLE_COLUMN_SIZES.NORMAL} |
| 116 | + shouldHighlightItemWhenSelected={false} |
| 117 | + shouldShowErrors={false} |
| 118 | + style={!shouldShowSelection && styles.pv2} |
| 119 | + /> |
| 120 | + </View> |
| 121 | + {shouldShowSelection && ( |
| 122 | + <View style={[styles.justifyContentCenter, styles.alignItemsCenter]}> |
| 123 | + <RadioButton |
| 124 | + isChecked={isSelected} |
| 125 | + onPress={() => onSelectTransaction(transaction.transactionID)} |
| 126 | + accessibilityLabel={CONST.ROLE.RADIO} |
| 127 | + shouldStopMouseDownPropagation |
| 128 | + style={[styles.justifyContentCenter, styles.alignItemsCenter]} |
| 129 | + /> |
| 130 | + </View> |
| 131 | + )} |
| 132 | + </View> |
122 | 133 | </PressableWithFeedback> |
123 | 134 | </OfflineWithFeedback> |
124 | 135 | ); |
|
0 commit comments