Skip to content

Commit

Permalink
Merge pull request #44742 from neonbhai/receipt-fallback-update
Browse files Browse the repository at this point in the history
Fix: Use different fallback receipt icon when displaying a Search row that has no receipt and isn't editable
  • Loading branch information
luacmartins authored Aug 5, 2024
2 parents 2eb65f8 + ba0b977 commit 66ae374
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ function ReceiptCell({transactionItem}: TransactionCellProps) {

const backgroundStyles = transactionItem.isSelected ? StyleUtils.getBackgroundColorStyle(theme.buttonHoveredBG) : StyleUtils.getBackgroundColorStyle(theme.border);

const isViewAction = transactionItem.action === CONST.SEARCH.ACTION_TYPES.VIEW;
const canModifyReceipt = isViewAction && transactionItem.canDelete;

return (
<View
style={[
Expand All @@ -92,7 +95,7 @@ function ReceiptCell({transactionItem}: TransactionCellProps) {
transactionID={transactionItem.transactionID}
shouldUseThumbnailImage={!transactionItem?.receipt?.source}
isAuthTokenRequired
fallbackIcon={Expensicons.ReceiptPlus}
fallbackIcon={canModifyReceipt ? Expensicons.ReceiptPlus : Expensicons.ReceiptSlash}
fallbackIconSize={20}
fallbackIconColor={theme.icon}
fallbackIconBackground={transactionItem.isSelected ? theme.buttonHoveredBG : undefined}
Expand Down

0 comments on commit 66ae374

Please sign in to comment.