@@ -79,8 +79,7 @@ class Modal extends Component {
79
79
}
80
80
render ( ) {
81
81
const { opacity, open, scale, offset, children} = this . state ;
82
- const { overlayOpacity} = this . props ;
83
- let containerStyles = [ styles . absolute , styles . container ] ;
82
+ let containerStyles = [ styles . absolute , styles . container , this . props . containerStyle ] ;
84
83
85
84
if ( ! this . state . open ) {
86
85
containerStyles . push ( styles . hidden ) ;
@@ -95,12 +94,12 @@ class Modal extends Component {
95
94
disabled = { ! this . props . closeOnTouchOutside }
96
95
onPress = { this . close . bind ( this ) }
97
96
activeOpacity = { 0.75 } >
98
- < Animated . View style = { { flex : 1 , opacity, backgroundColor : 'rgba(0, 0, 0, ' + overlayOpacity + ')' } } />
97
+ < Animated . View style = { { flex : 1 , opacity, backgroundColor : this . props . overlayBackground } } />
99
98
</ TouchableOpacity >
100
99
< Animated . View
101
100
style = { [
102
101
styles . defaultModalStyle ,
103
- this . props . style ,
102
+ this . props . modalStyle ,
104
103
{ opacity, transform : [ { scale} , { translateY : offset } ] }
105
104
] } >
106
105
{ children }
@@ -126,7 +125,6 @@ class Modal extends Component {
126
125
Modal . propTypes = {
127
126
open : PropTypes . bool ,
128
127
offset : PropTypes . number ,
129
- overlayOpacity : PropTypes . number ,
130
128
animationDuration : PropTypes . number ,
131
129
animationTension : PropTypes . number ,
132
130
modalDidOpen : PropTypes . func ,
@@ -137,7 +135,7 @@ Modal.propTypes = {
137
135
Modal . defaultProps = {
138
136
open : false ,
139
137
offset : 0 ,
140
- overlayOpacity : 0 .75,
138
+ overlayBackground : 'rgba(0, 0, 0, 0 .75)' ,
141
139
animationDuration : 200 ,
142
140
animationTension : 40 ,
143
141
modalDidOpen : ( ) => undefined ,
0 commit comments