Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ type MoneyRequestReportTransactionItemProps = ForwardedFSClassProps & {

/** Callback function that scrolls to this transaction in case it is newly added */
scrollToNewTransaction?: (offset: number) => void;

/** Callback function that navigates to the transaction thread */
onArrowRightPress?: (transactionID: string) => void;
};

const expenseHeaders = getExpenseHeaders();
Expand All @@ -78,6 +81,7 @@ function MoneyRequestReportTransactionItem({
taxAmountColumnSize,
scrollToNewTransaction,
forwardedFSClass,
onArrowRightPress,
}: MoneyRequestReportTransactionItemProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
Expand Down Expand Up @@ -154,6 +158,7 @@ function MoneyRequestReportTransactionItem({
onButtonPress={() => {
Comment thread
Krishna2323 marked this conversation as resolved.
Resolved
handleOnPress(transaction.transactionID);
}}
onArrowRightPress={() => onArrowRightPress?.(transaction.transactionID)}
/>
</PressableWithFeedback>
</OfflineWithFeedback>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ function MoneyRequestReportTransactionList({
[isMobileSelectionModeEnabled, toggleTransaction, navigateToTransaction],
);

const handleArrowRightPress = useCallback(
(transactionID: string) => {
navigateToTransaction(transactionID);
},
[navigateToTransaction],
);

const listHorizontalPadding = styles.ph5;

const transactionItemFSClass = FS.getChatFSClass(personalDetailsList, report);
Expand Down Expand Up @@ -392,6 +399,7 @@ function MoneyRequestReportTransactionList({
// if we add few new transactions, then we need to scroll to the first one
scrollToNewTransaction={transaction.transactionID === newTransactions?.at(0)?.transactionID ? scrollToNewTransaction : undefined}
forwardedFSClass={transactionItemFSClass}
onArrowRightPress={handleArrowRightPress}
/>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ function Search({
onDEWModalOpen={handleDEWModalOpen}
SearchTableHeader={
!shouldShowTableHeader ? undefined : (
<View style={[styles.pr8, styles.flex1]}>
<View style={[!isTask && styles.pr8, styles.flex1]}>
<SearchTableHeader
canSelectMultiple={canSelectMultiple}
columns={columnsToShow}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function TransactionGroupListExpanded<TItem extends ListItem>({
isInSingleTransactionReport={isInSingleTransactionReport}
areAllOptionalColumnsHidden={areAllOptionalColumnsHidden}
shouldShowBottomBorder={shouldShowBottomBorder}
onArrowRightPress={() => openReportInRHP(transaction)}
Comment thread
Krishna2323 marked this conversation as resolved.
Resolved
/>
</OfflineWithFeedback>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function TransactionListItem<TItem extends ListItem>({
style={[styles.p3, styles.pv2, shouldUseNarrowLayout ? styles.pt2 : {}, isLargeScreenWidth && styles.pr0]}
areAllOptionalColumnsHidden={areAllOptionalColumnsHidden}
violations={transactionViolations}
onArrowRightPress={onPress}
/>
</PressableWithFeedback>
</OfflineWithFeedback>
Expand Down
6 changes: 4 additions & 2 deletions src/components/TransactionItemRow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ type TransactionItemRowProps = {
areAllOptionalColumnsHidden?: boolean;
violations?: TransactionViolation[];
shouldShowBottomBorder?: boolean;
onArrowRightPress?: () => void;
};

function getMerchantName(transactionItem: TransactionWithOptionalSearchFields, translate: (key: TranslationPaths) => string) {
Expand Down Expand Up @@ -153,6 +154,7 @@ function TransactionItemRow({
areAllOptionalColumnsHidden = false,
violations,
shouldShowBottomBorder,
onArrowRightPress,
}: TransactionItemRowProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
Expand Down Expand Up @@ -554,9 +556,9 @@ function TransactionItemRow({
/>
</View>
)}
{!!isLargeScreenWidth && (
{!!isLargeScreenWidth && !!onArrowRightPress && (
<PressableWithFeedback
onPress={() => onButtonPress()}
onPress={() => onArrowRightPress?.()}
style={[styles.p3Half, styles.pl0half, styles.justifyContentCenter, styles.alignItemsEnd]}
accessibilityRole={CONST.ROLE.BUTTON}
accessibilityLabel={CONST.ROLE.BUTTON}
Expand Down