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

Fix long press on an empty receipt doesn't show the context menu #54100

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
8 changes: 5 additions & 3 deletions src/components/ReceiptEmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ type ReceiptEmptyStateProps = {
};

// Returns an SVG icon indicating that the user should attach a receipt
function ReceiptEmptyState({hasError = false, onPress = () => {}, disabled = false, isThumbnail = false}: ReceiptEmptyStateProps) {
function ReceiptEmptyState({hasError = false, onPress, disabled = false, isThumbnail = false}: ReceiptEmptyStateProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const theme = useTheme();

const Wrapper = onPress ? PressableWithoutFeedback : View;

return (
<PressableWithoutFeedback
<Wrapper
accessibilityRole="imagebutton"
accessibilityLabel={translate('receipt.upload')}
onPress={onPress}
Expand Down Expand Up @@ -57,7 +59,7 @@ function ReceiptEmptyState({hasError = false, onPress = () => {}, disabled = fal
/>
)}
</View>
</PressableWithoutFeedback>
</Wrapper>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ function MoneyRequestPreviewContent({
images={receiptImages}
isHovered={isHovered || isScanning}
size={1}
onPress={shouldDisableOnPress ? undefined : onPreviewPressed}
/>
{isEmptyObject(transaction) && !ReportActionsUtils.isMessageDeleted(action) && action.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE ? (
<MoneyRequestSkeletonView />
Expand Down
1 change: 0 additions & 1 deletion src/components/ReportActionItem/ReportPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ function ReportPreview({
images={lastThreeReceipts}
total={allTransactions.length}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
onPress={openReportFromPreview}

This comment was marked as resolved.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, this action is also handled by the parent container so it's fine to remove it.

/>
<View style={[styles.expenseAndReportPreviewBoxBody, hasReceipts ? styles.mtn1 : {}]}>
<View style={shouldShowSettlementButton ? {} : styles.expenseAndReportPreviewTextButtonContainer}>
Expand Down
Loading