Skip to content

Commit d5d4a59

Browse files
committed
move to const
1 parent 8e9d8c2 commit d5d4a59

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/components/TransactionItemRow/ReceiptPreview

src/components/TransactionItemRow/ReceiptPreview/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import CONST from '@src/CONST';
1717
import type {Transaction} from '@src/types/onyx';
1818

1919
const eReceiptAspectRatio = variables.eReceiptBGHWidth / variables.eReceiptBGHeight;
20+
const verticalPreviewMargin = 120; // 60px top margin and 60px bottom margin
2021

2122
type ReceiptPreviewProps = {
2223
/** Path to the image to be opened in the preview */
@@ -55,9 +56,8 @@ function ReceiptPreview({source, hovered, isEReceipt = false, transactionItem}:
5556
hasMeasured.current = false;
5657
return;
5758
}
58-
if (height * eReceiptScaleFactor > windowHeight - 120) {
59-
// 120 value is taken from this comment: https://github.com/Expensify/App/pull/65184#issuecomment-3052852162
60-
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / (windowHeight - 120));
59+
if (height * eReceiptScaleFactor > windowHeight - verticalPreviewMargin) {
60+
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / (windowHeight - verticalPreviewMargin));
6161
return;
6262
}
6363
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / height);

0 commit comments

Comments
 (0)