Skip to content

Commit 88735de

Browse files
authored
Merge pull request #7933 from Expensify/revert-7723-feat/7584-image-placeholder
2 parents be2a0d8 + 32c0fd3 commit 88735de

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

src/components/ImageWithSizeCalculation.js

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React, {PureComponent} from 'react';
2-
import {Image, ActivityIndicator} from 'react-native';
2+
import {Image} from 'react-native';
33
import PropTypes from 'prop-types';
44
import Log from '../libs/Log';
55
import styles from '../styles/styles';
66
import makeCancellablePromise from '../libs/MakeCancellablePromise';
7-
import themeColors from '../styles/themes/default';
87

98
const propTypes = {
109
/** Url for image to display */
@@ -30,14 +29,6 @@ const defaultProps = {
3029
* it can be appropriately resized.
3130
*/
3231
class ImageWithSizeCalculation extends PureComponent {
33-
constructor(props) {
34-
super(props);
35-
36-
this.state = {
37-
isLoading: true,
38-
};
39-
}
40-
4132
componentDidMount() {
4233
this.calculateImageSize();
4334
}
@@ -94,26 +85,15 @@ class ImageWithSizeCalculation extends PureComponent {
9485

9586
render() {
9687
return (
97-
<>
98-
<Image
99-
style={[
100-
styles.w100,
101-
styles.h100,
102-
this.state.isLoading && styles.dNone,
103-
this.props.style,
104-
]}
105-
source={{uri: this.props.url}}
106-
resizeMode="contain"
107-
onLoadEnd={() => this.setState({isLoading: false})}
108-
/>
109-
{this.state.isLoading && (
110-
<ActivityIndicator
111-
size="large"
112-
style={[styles.flex1]}
113-
color={themeColors.textSupporting}
114-
/>
115-
)}
116-
</>
88+
<Image
89+
style={[
90+
styles.w100,
91+
styles.h100,
92+
this.props.style,
93+
]}
94+
source={{uri: this.props.url}}
95+
resizeMode="contain"
96+
/>
11797
);
11898
}
11999
}

0 commit comments

Comments
 (0)