Skip to content

Commit

Permalink
Report Preview fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Oct 16, 2023
1 parent 6723913 commit 1d34ee5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ const CONST = {
HAND_ICON_HEIGHT: 152,
HAND_ICON_WIDTH: 200,
SHUTTER_SIZE: 90,
MAX_REPORT_PREVIEW_RECEIPTS: 3,
},
REPORT: {
MAXIMUM_PARTICIPANTS: 8,
Expand Down
6 changes: 4 additions & 2 deletions src/components/ReportActionItem/ReportActionItemImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ const defaultProps = {
*/

function ReportActionItemImages({images, size, total, isHovered}) {
const numberOfShownImages = size || images.length;
const shownImages = images.slice(0, size);
// Calculate the number of images to be shown, limited by the value of 'size' (if defined)
// or the total number of images.
const numberOfShownImages = Math.min(size || images.length, images.length);
const shownImages = images.slice(0, numberOfShownImages);
const remaining = (total || images.length) - size;
const MAX_REMAINING = 9;

Expand Down
1 change: 1 addition & 0 deletions src/components/ReportActionItem/ReportPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function ReportPreview(props) {
images={lastThreeReceipts}
total={transactionsWithReceipts.length}
isHovered={props.isHovered || isScanning}
size={CONST.RECEIPT.MAX_REPORT_PREVIEW_RECEIPTS}
/>
)}
<View style={styles.reportPreviewBoxBody}>
Expand Down

0 comments on commit 1d34ee5

Please sign in to comment.