1
1
import _ from 'lodash' ;
2
2
import React , { Component } from 'react' ;
3
3
import { StyleSheet } from 'react-native' ;
4
- import { LogService } from '../../services' ;
5
4
import { Constants } from '../../helpers' ;
6
5
import { Typography , Colors } from '../../style' ;
7
6
import { asBaseComponent } from '../../commons/new' ;
@@ -11,40 +10,30 @@ import Button from '../../components/button';
11
10
import Text from '../../components/text' ;
12
11
import { StateScreenProps } from './types' ;
13
12
13
+
14
14
class StateScreen extends Component < StateScreenProps > {
15
15
static displayName = 'StateScreen' ;
16
16
17
17
styles : any ;
18
18
constructor ( props : StateScreenProps ) {
19
19
super ( props ) ;
20
-
21
- if ( props . testId ) {
22
- LogService . deprecationWarn ( { component : 'StateScreen' , oldProp : 'testId' , newProp : 'testID' } ) ;
23
-
24
- }
25
- if ( props . source ) {
26
- LogService . deprecationWarn ( { component : 'StateScreen' , oldProp : 'source' , newProp : 'imageSource' } ) ;
27
- }
28
20
29
21
this . generateStyles ( ) ;
30
22
}
31
23
32
24
generateStyles ( ) {
33
- const { source, imageSource} = this . props ;
34
- const finalSource = imageSource || source ;
25
+ const { imageSource} = this . props ;
35
26
36
- const isRemoteImage = _ . isObject ( finalSource ) && Boolean ( finalSource . uri ) ;
27
+ const isRemoteImage = _ . isObject ( imageSource ) && Boolean ( imageSource . uri ) ;
37
28
this . styles = createStyles ( isRemoteImage ) ;
38
29
}
39
30
40
31
render ( ) {
41
- // TODO: remove testId and source after deprecation
42
- const { title, subtitle, source, imageSource, ctaLabel, onCtaPress, testId, testID} = this . props ;
43
- const finalSource = imageSource || source ;
32
+ const { title, subtitle, imageSource, ctaLabel, onCtaPress, testID} = this . props ;
44
33
45
34
return (
46
- < View style = { this . styles . container } testID = { testID || testId } >
47
- < Image style = { this . styles . image } resizeMode = { 'contain' } source = { finalSource } />
35
+ < View style = { this . styles . container } testID = { testID } >
36
+ < Image style = { this . styles . image } resizeMode = { 'contain' } source = { imageSource } />
48
37
< Text style = { [ this . styles . title ] } > { title } </ Text >
49
38
< Text style = { [ this . styles . subtitle ] } > { subtitle } </ Text >
50
39
< Button
0 commit comments