Skip to content

Commit

Permalink
Merge pull request #39572 from nkdengineer/fix/39436
Browse files Browse the repository at this point in the history
[CP Staging] Fix three-dot menu item display incorrectly when opening receipt in combine report
  • Loading branch information
mountiny authored Apr 5, 2024
2 parents 2995f2c + 13c9220 commit 54db9cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/ReportActionItemImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ function ReportActionItemImage({
if (enablePreviewModal) {
return (
<ShowContextMenuContext.Consumer>
{({report}) => (
{({report, transactionThreadReport}) => (
<PressableWithoutFocus
style={[styles.w100, styles.h100, styles.noOutline as ViewStyle]}
onPress={() => Navigation.navigate(ROUTES.TRANSACTION_RECEIPT.getRoute(report?.reportID ?? '', transaction?.transactionID ?? ''))}
onPress={() =>
Navigation.navigate(ROUTES.TRANSACTION_RECEIPT.getRoute(transactionThreadReport?.reportID ?? report?.reportID ?? '', transaction?.transactionID ?? ''))
}
accessibilityLabel={translate('accessibilityHints.viewAttachment')}
accessibilityRole={CONST.ROLE.BUTTON}
>
Expand Down
2 changes: 2 additions & 0 deletions src/components/ShowContextMenuContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ type ShowContextMenuContextProps = {
anchor: ContextMenuAnchor;
report: OnyxEntry<Report>;
action: OnyxEntry<ReportAction>;
transactionThreadReport: OnyxEntry<Report>;
checkIfContextMenuActive: () => void;
};

const ShowContextMenuContext = createContext<ShowContextMenuContextProps>({
anchor: null,
report: null,
action: null,
transactionThreadReport: null,
checkIfContextMenuActive: () => {},
});

Expand Down
3 changes: 2 additions & 1 deletion src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,10 @@ function ReportActionItem({
anchor: popoverAnchorRef.current,
report,
action,
transactionThreadReport,
checkIfContextMenuActive: toggleContextMenuFromActiveReportAction,
}),
[report, action, toggleContextMenuFromActiveReportAction],
[report, action, toggleContextMenuFromActiveReportAction, transactionThreadReport],
);

const actionableItemButtons: ActionableItem[] = useMemo(() => {
Expand Down

0 comments on commit 54db9cc

Please sign in to comment.