Skip to content

Commit 818cfe7

Browse files
committed
move to const
1 parent d5d4a59 commit 818cfe7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/CONST/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,7 @@ const CONST = {
10351035
SHUTTER_SIZE: 90,
10361036
MAX_REPORT_PREVIEW_RECEIPTS: 3,
10371037
},
1038+
RECEIPT_PREVIEW_TOP_BOTTOM_MARGIN: 120,
10381039
REPORT: {
10391040
ROLE: {
10401041
ADMIN: 'admin',

src/components/TransactionItemRow/ReceiptPreview/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ 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
2120

2221
type ReceiptPreviewProps = {
2322
/** Path to the image to be opened in the preview */
@@ -56,8 +55,8 @@ function ReceiptPreview({source, hovered, isEReceipt = false, transactionItem}:
5655
hasMeasured.current = false;
5756
return;
5857
}
59-
if (height * eReceiptScaleFactor > windowHeight - verticalPreviewMargin) {
60-
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / (windowHeight - verticalPreviewMargin));
58+
if (height * eReceiptScaleFactor > windowHeight - CONST.RECEIPT_PREVIEW_TOP_BOTTOM_MARGIN) {
59+
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / (windowHeight - CONST.RECEIPT_PREVIEW_TOP_BOTTOM_MARGIN));
6160
return;
6261
}
6362
setDistanceEReceiptAspectRatio(variables.eReceiptBGHWidth / height);

0 commit comments

Comments
 (0)