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 @@ -87,6 +87,7 @@ function MoneyRequestReportPreview({
<TransactionPreview
chatReportID={chatReportID}
action={getIOUActionForReportID(item.reportID, item.transactionID)}
contextAction={action}
reportID={item.reportID}
isBillSplit={isSplitBillAction}
isTrackExpense={isTrackExpenseAction}
Expand All @@ -95,9 +96,11 @@ function MoneyRequestReportPreview({
isHovered={isHovered}
iouReportID={iouReportID}
containerStyles={[styles.h100, reportPreviewStyles.transactionPreviewStyle, containerStyles]}
shouldDisplayContextMenu={shouldDisplayContextMenu}
Comment thread
JakubKorytko marked this conversation as resolved.
transactionPreviewWidth={reportPreviewStyles.transactionPreviewStyle.width}
transactionID={item.transactionID}
reportPreviewAction={action}
onPreviewPressed={openReportFromPreview}
shouldShowIOUData={shouldShowIOUData}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function TransactionPreview(props: TransactionPreviewProps) {
iouReportID,
transactionID: transactionIDFromProps,
onPreviewPressed,
contextAction,
} = props;

const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID}`, {canBeMissing: true});
Expand Down Expand Up @@ -64,7 +65,7 @@ function TransactionPreview(props: TransactionPreviewProps) {
if (!shouldDisplayContextMenu) {
return;
}
showContextMenuForReport(event, contextMenuAnchor, reportID, action, checkIfContextMenuActive);
showContextMenuForReport(event, contextMenuAnchor, contextAction ? chatReportID : reportID, contextAction ?? action, checkIfContextMenuActive);
};

const offlineWithFeedbackOnClose = useCallback(() => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/ReportActionItem/TransactionPreview/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ type TransactionPreviewProps = {

/** Whether to show payer/receiver data in the preview */
shouldShowIOUData?: boolean;

/** In case we want to override context menu action */
contextAction?: OnyxEntry<ReportAction>;
};

type TransactionPreviewContentProps = {
Expand Down