Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP Staging] Fix three-dot menu item display incorrectly when opening receipt in combine report #39572

Merged
merged 1 commit into from
Apr 5, 2024
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
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
Loading