1
1
import React , { PureComponent } from 'react' ;
2
- import { View , StyleSheet , ImageSourcePropType } from 'react-native' ;
3
- import { LogService } from '../../services' ;
2
+ import { View , StyleSheet } from 'react-native' ;
4
3
// import {BaseComponent} from '../../commons';
5
4
import Image , { ImageProps } from '../image' ;
6
5
import * as CardPresenter from './CardPresenter' ;
7
6
import asCardChild , { asCardChildProps } from './asCardChild' ;
8
7
9
8
10
- // TODO: Remove omitting source after imageSource deprecation (since it's required for Image)
11
- export type CardImageProps = Omit < ImageProps , 'source' > & {
12
- /**
13
- * Image source, either remote source or local. Note: for remote pass object {uri: <remote_uri_string>}
14
- */
15
- imageSource ?: ImageSourcePropType ;
16
- source ?: ImageSourcePropType ; //TODO: Remove after imageSource deprecation - should take it from ImageProps
9
+ export type CardImageProps = ImageProps & {
17
10
/**
18
11
* Image width
19
12
*/
@@ -28,10 +21,6 @@ export type CardImageProps = Omit<ImageProps, 'source'> & {
28
21
* Card component
29
22
*/
30
23
position ?: string [ ] ;
31
- /**
32
- * border radius, basically for Android since overflow doesn't work well (deprecated)
33
- */
34
- borderRadius ?: number ;
35
24
} ;
36
25
37
26
type Props = CardImageProps & asCardChildProps ;
@@ -49,32 +38,23 @@ class CardImage extends PureComponent<Props> {
49
38
super ( props ) ;
50
39
51
40
this . styles = createStyles ( props ) ;
52
-
53
- if ( props . imageSource ) {
54
- LogService . deprecationWarn ( { component : 'CardImage' , oldProp : 'imageSource' , newProp : 'source' } ) ;
55
- }
56
- if ( props . borderRadius ) {
57
- LogService . deprecationWarn ( { component : 'CardImage' , oldProp : 'borderRadius' } ) ;
58
- }
59
41
}
60
42
61
43
render ( ) {
62
44
const {
63
- imageSource,
64
45
source,
65
46
style,
66
47
testID,
67
48
overlayType,
68
49
context : { borderStyle}
69
50
} = this . props ;
70
- const finalSource = source || imageSource ;
71
51
72
- if ( finalSource ) {
52
+ if ( source ) {
73
53
return (
74
54
< View style = { [ this . styles . container , borderStyle , style ] } >
75
55
< Image
76
56
testID = { testID }
77
- source = { finalSource }
57
+ source = { source }
78
58
style = { [ this . styles . image ] }
79
59
overlayType = { overlayType }
80
60
/>
0 commit comments