File tree 1 file changed +10
-30
lines changed 1 file changed +10
-30
lines changed Original file line number Diff line number Diff line change 1
1
import React , { PureComponent } from 'react' ;
2
- import { Image , ActivityIndicator } from 'react-native' ;
2
+ import { Image } from 'react-native' ;
3
3
import PropTypes from 'prop-types' ;
4
4
import Log from '../libs/Log' ;
5
5
import styles from '../styles/styles' ;
6
6
import makeCancellablePromise from '../libs/MakeCancellablePromise' ;
7
- import themeColors from '../styles/themes/default' ;
8
7
9
8
const propTypes = {
10
9
/** Url for image to display */
@@ -30,14 +29,6 @@ const defaultProps = {
30
29
* it can be appropriately resized.
31
30
*/
32
31
class ImageWithSizeCalculation extends PureComponent {
33
- constructor ( props ) {
34
- super ( props ) ;
35
-
36
- this . state = {
37
- isLoading : true ,
38
- } ;
39
- }
40
-
41
32
componentDidMount ( ) {
42
33
this . calculateImageSize ( ) ;
43
34
}
@@ -94,26 +85,15 @@ class ImageWithSizeCalculation extends PureComponent {
94
85
95
86
render ( ) {
96
87
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
+ />
117
97
) ;
118
98
}
119
99
}
You can’t perform that action at this time.
0 commit comments