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 missing context menu options on money request preview #35285

Merged
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
5 changes: 5 additions & 0 deletions src/components/ReportActionItem/MoneyRequestAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ const propTypes = {
/** The ID of the associated request report */
requestReportID: PropTypes.string.isRequired,

/** The ID of the current report */
reportID: PropTypes.string.isRequired,

/** Is this IOUACTION the most recent? */
isMostRecentIOUReportAction: PropTypes.bool.isRequired,

Expand Down Expand Up @@ -81,6 +84,7 @@ function MoneyRequestAction({
action,
chatReportID,
requestReportID,
reportID,
isMostRecentIOUReportAction,
contextMenuAnchor,
checkIfContextMenuActive,
Expand Down Expand Up @@ -136,6 +140,7 @@ function MoneyRequestAction({
<MoneyRequestPreview
iouReportID={requestReportID}
chatReportID={chatReportID}
reportID={reportID}
isBillSplit={isSplitBillAction}
action={action}
contextMenuAnchor={contextMenuAnchor}
Expand Down
5 changes: 4 additions & 1 deletion src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ const propTypes = {
/** The associated chatReport */
chatReportID: PropTypes.string.isRequired,

/** The ID of the current report */
reportID: PropTypes.string.isRequired,

/** Callback for the preview pressed */
onPreviewPressed: PropTypes.func,

Expand Down Expand Up @@ -188,7 +191,7 @@ function MoneyRequestPreview(props) {
};

const showContextMenu = (event) => {
showContextMenuForReport(event, props.contextMenuAnchor, props.chatReportID, props.action, props.checkIfContextMenuActive);
showContextMenuForReport(event, props.contextMenuAnchor, props.reportID, props.action, props.checkIfContextMenuActive);
};

const getPreviewHeaderText = () => {
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ function ReportActionItem(props) {
// If originalMessage.iouReportID is set, this is a 1:1 money request in a DM chat whose reportID is props.report.chatReportID
chatReportID={originalMessage.IOUReportID ? props.report.chatReportID : props.report.reportID}
requestReportID={iouReportID}
reportID={props.report.reportID}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use my alt solution as it's much easier to understand.

action={props.action}
isMostRecentIOUReportAction={props.isMostRecentIOUReportAction}
isHovered={hovered}
Expand Down
Loading