Skip to content

Commit 55faaf6

Browse files
adids1221ethanshar
authored andcommitted
Fix/thumbnail resize android (#2150)
* Fixed thumbnail resize bug on android, the bug was in image component * Prettier eslint code format * Update snapshot * Fixed reviwe notes * Fixed review notes
1 parent d2b15db commit 55faaf6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/components/button/__tests__/__snapshots__/index.spec.js.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ exports[`Button container size should have no padding of button is an icon butto
916916
undefined,
917917
undefined,
918918
undefined,
919+
false,
919920
Array [
920921
Object {
921922
"marginRight": 8,
@@ -1841,6 +1842,7 @@ exports[`Button icon should apply color on icon 1`] = `
18411842
undefined,
18421843
undefined,
18431844
undefined,
1845+
false,
18441846
Array [
18451847
Object {
18461848
"tintColor": "green",
@@ -1897,6 +1899,7 @@ exports[`Button icon should apply color on icon 2`] = `
18971899
undefined,
18981900
undefined,
18991901
undefined,
1902+
false,
19001903
Array [
19011904
Object {
19021905
"tintColor": "#FC3D2F",
@@ -1953,6 +1956,7 @@ exports[`Button icon should include custom iconStyle provided as a prop 1`] = `
19531956
undefined,
19541957
undefined,
19551958
undefined,
1959+
false,
19561960
Array [
19571961
Object {
19581962
"tintColor": "#FFFFFF",
@@ -2014,6 +2018,7 @@ exports[`Button icon should return icon style according to different variations
20142018
undefined,
20152019
undefined,
20162020
undefined,
2021+
false,
20172022
Array [
20182023
Object {
20192024
"tintColor": "#5A48F5",
@@ -2070,6 +2075,7 @@ exports[`Button icon should return icon style according to different variations
20702075
undefined,
20712076
undefined,
20722077
undefined,
2078+
false,
20732079
Array [
20742080
Object {
20752081
"tintColor": "#5A48F5",
@@ -2131,6 +2137,7 @@ exports[`Button icon should return icon style according to different variations
21312137
undefined,
21322138
undefined,
21332139
undefined,
2140+
false,
21342141
Array [
21352142
Object {
21362143
"tintColor": "#FFFFFF",
@@ -3145,6 +3152,7 @@ exports[`Button labelColor should return undefined color if this is an icon butt
31453152
undefined,
31463153
undefined,
31473154
undefined,
3155+
false,
31483156
Array [
31493157
Object {
31503158
"tintColor": "#FFFFFF",

src/components/image/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ class Image extends PureComponent<Props, State> {
206206
const shouldFlipRTL = supportRTL && Constants.isRTL;
207207
const ImageView = this.shouldUseImageBackground() ? ImageBackground : RNImage;
208208
const {margins} = modifiers;
209-
const resizeMode = useImageInsideContainer ? 'contain' : undefined;
210209

211210
return (
212211
// @ts-ignore
@@ -218,10 +217,10 @@ class Image extends PureComponent<Props, State> {
218217
this.isGif() && styles.gifImage,
219218
aspectRatio && {aspectRatio},
220219
!useImageInsideContainer && margins,
220+
useImageInsideContainer && styles.containImage,
221221
style,
222222
useImageInsideContainer && styles.shrink
223223
]}
224-
resizeMode={resizeMode}
225224
accessible={false}
226225
accessibilityRole={'image'}
227226
{...others}
@@ -276,6 +275,9 @@ const styles = StyleSheet.create({
276275
},
277276
shrink: {
278277
flexShrink: 1
278+
},
279+
containImage: {
280+
resizeMode: 'contain'
279281
}
280282
});
281283

0 commit comments

Comments
 (0)