@@ -21,7 +21,7 @@ export enum OverlayIntensityType {
21
21
HIGH = 'high'
22
22
}
23
23
24
- export type OverlayTypeType = typeof OVERLY_TYPES [ keyof typeof OVERLY_TYPES ] ;
24
+ export type OverlayTypeType = ( typeof OVERLY_TYPES ) [ keyof typeof OVERLY_TYPES ] ;
25
25
26
26
export type OverlayTypes = Pick < ImageProps , 'borderRadius' > & {
27
27
/**
@@ -88,8 +88,7 @@ class Overlay extends PureComponent<OverlayTypes> {
88
88
} ;
89
89
90
90
renderImage = ( style : any , source : ImageSourcePropType ) => {
91
- const { borderRadius} = this . props ;
92
- return < Image style = { [ styles . container , style ] } resizeMode = { 'stretch' } source = { source } borderRadius = { borderRadius } /> ;
91
+ return < Image style = { [ styles . container , style ] } resizeMode = { 'stretch' } source = { source } /> ;
93
92
} ;
94
93
95
94
getImageSource = ( type ?: OverlayTypeType , intensity ?: OverlayTypes [ 'intensity' ] ) => {
@@ -105,24 +104,24 @@ class Overlay extends PureComponent<OverlayTypes> {
105
104
} ;
106
105
107
106
render ( ) {
108
- const { type, intensity, customContent} = this . props ;
107
+ const { type, intensity, customContent, borderRadius } = this . props ;
109
108
const imageSource = this . getImageSource ( type , intensity ) ;
110
109
111
- if ( type === OVERLY_TYPES . VERTICAL ) {
112
- return (
113
- < >
114
- { this . renderImage ( [ this . getStyleByType ( OVERLY_TYPES . TOP ) , styles . vertical ] , imageSource ) }
115
- { this . renderImage ( [ this . getStyleByType ( OVERLY_TYPES . BOTTOM ) , styles . vertical ] , imageSource ) }
116
- { customContent && this . renderCustomContent ( ) }
117
- </ >
118
- ) ;
119
- }
120
-
121
110
return (
122
- < >
123
- { type && this . renderImage ( this . getStyleByType ( ) , imageSource ) }
124
- { customContent && this . renderCustomContent ( ) }
125
- </ >
111
+ < View flex style = { { overflow : 'hidden' , borderRadius} } >
112
+ { type === OVERLY_TYPES . VERTICAL ? (
113
+ < >
114
+ { this . renderImage ( [ this . getStyleByType ( OVERLY_TYPES . TOP ) , styles . vertical ] , imageSource ) }
115
+ { this . renderImage ( [ this . getStyleByType ( OVERLY_TYPES . BOTTOM ) , styles . vertical ] , imageSource ) }
116
+ { customContent && this . renderCustomContent ( ) }
117
+ </ >
118
+ ) : (
119
+ < >
120
+ { type && this . renderImage ( this . getStyleByType ( ) , imageSource ) }
121
+ { customContent && this . renderCustomContent ( ) }
122
+ </ >
123
+ ) }
124
+ </ View >
126
125
) ;
127
126
}
128
127
}
@@ -134,14 +133,12 @@ const styles = StyleSheet.create({
134
133
} ,
135
134
top : {
136
135
bottom : undefined ,
137
- top : 0 ,
138
136
height : '75%'
139
137
} ,
140
138
bottom : {
141
- bottom : 0 ,
142
139
top : undefined ,
143
- height : '75%' ,
144
- transform : [ { scaleY : - 1 } ]
140
+ transform : [ { scaleY : - 1 } ] ,
141
+ height : '75%'
145
142
} ,
146
143
vertical : {
147
144
height : '40%'
0 commit comments