|
2 | 2 | import React from 'react';
|
3 | 3 | import {View} from 'react-native';
|
4 | 4 | import {Polygon, Svg} from 'react-native-svg';
|
| 5 | +import {ImageBehaviorContextProvider} from '@components/Image/ImageBehaviorContextProvider'; |
5 | 6 | import Text from '@components/Text';
|
6 | 7 | import useStyleUtils from '@hooks/useStyleUtils';
|
7 | 8 | import useTheme from '@hooks/useTheme';
|
@@ -65,28 +66,30 @@ function ReportActionItemImages({images, size, total, isHovered = false}: Report
|
65 | 66 | return (
|
66 | 67 | <View style={styles.reportActionItemImagesContainer}>
|
67 | 68 | <View style={[styles.reportActionItemImages, hoverStyle, heightStyle]}>
|
68 |
| - {shownImages.map(({thumbnail, isThumbnail, image, transaction, isLocalFile, fileExtension, filename}, index) => { |
69 |
| - // Show a border to separate multiple images. Shown to the right for each except the last. |
70 |
| - const shouldShowBorder = shownImages.length > 1 && index < shownImages.length - 1; |
71 |
| - const borderStyle = shouldShowBorder ? styles.reportActionItemImageBorder : {}; |
72 |
| - return ( |
73 |
| - <View |
74 |
| - key={`${index}-${image}`} |
75 |
| - style={[styles.reportActionItemImage, borderStyle, hoverStyle]} |
76 |
| - > |
77 |
| - <ReportActionItemImage |
78 |
| - thumbnail={thumbnail} |
79 |
| - fileExtension={fileExtension} |
80 |
| - image={image} |
81 |
| - isLocalFile={isLocalFile} |
82 |
| - filename={filename} |
83 |
| - transaction={transaction} |
84 |
| - isThumbnail={isThumbnail} |
85 |
| - isSingleImage={numberOfShownImages === 1} |
86 |
| - /> |
87 |
| - </View> |
88 |
| - ); |
89 |
| - })} |
| 69 | + <ImageBehaviorContextProvider shouldSetAspectRatioInStyle={false}> |
| 70 | + {shownImages.map(({thumbnail, isThumbnail, image, transaction, isLocalFile, fileExtension, filename}, index) => { |
| 71 | + // Show a border to separate multiple images. Shown to the right for each except the last. |
| 72 | + const shouldShowBorder = shownImages.length > 1 && index < shownImages.length - 1; |
| 73 | + const borderStyle = shouldShowBorder ? styles.reportActionItemImageBorder : {}; |
| 74 | + return ( |
| 75 | + <View |
| 76 | + key={`${index}-${image}`} |
| 77 | + style={[styles.reportActionItemImage, borderStyle, hoverStyle]} |
| 78 | + > |
| 79 | + <ReportActionItemImage |
| 80 | + thumbnail={thumbnail} |
| 81 | + fileExtension={fileExtension} |
| 82 | + image={image} |
| 83 | + isLocalFile={isLocalFile} |
| 84 | + filename={filename} |
| 85 | + transaction={transaction} |
| 86 | + isThumbnail={isThumbnail} |
| 87 | + isSingleImage={numberOfShownImages === 1} |
| 88 | + /> |
| 89 | + </View> |
| 90 | + ); |
| 91 | + })} |
| 92 | + </ImageBehaviorContextProvider> |
90 | 93 | </View>
|
91 | 94 | {remaining > 0 && (
|
92 | 95 | <View style={[styles.reportActionItemImagesMoreContainer]}>
|
|
0 commit comments