@@ -11,6 +11,31 @@ import {
1111} from 'react-native'
1212
1313class Modal extends Component {
14+
15+ static propTypes = {
16+ open : PropTypes . bool ,
17+ offset : PropTypes . number ,
18+ overlayBackground : PropTypes . string ,
19+ animationDuration : PropTypes . number ,
20+ animationTension : PropTypes . number ,
21+ modalDidOpen : PropTypes . func ,
22+ modalDidClose : PropTypes . func ,
23+ closeOnTouchOutside : PropTypes . bool ,
24+ disableOnBackPress : PropTypes . bool ,
25+ } ;
26+
27+ static defaultProps = {
28+ open : false ,
29+ offset : 0 ,
30+ overlayBackground : 'rgba(0, 0, 0, 0.75)' ,
31+ animationDuration : 200 ,
32+ animationTension : 40 ,
33+ modalDidOpen : ( ) => undefined ,
34+ modalDidClose : ( ) => undefined ,
35+ closeOnTouchOutside : true ,
36+ disableOnBackPress : false ,
37+ } ;
38+
1439 constructor ( ) {
1540 super ( ) ;
1641
@@ -151,31 +176,6 @@ class Modal extends Component {
151176 }
152177}
153178
154- Modal . propTypes = {
155- open : PropTypes . bool ,
156- offset : PropTypes . number ,
157- overlayBackground : PropTypes . string ,
158- animationDuration : PropTypes . number ,
159- animationTension : PropTypes . number ,
160- modalDidOpen : PropTypes . func ,
161- modalDidClose : PropTypes . func ,
162- closeOnTouchOutside : PropTypes . bool ,
163- disableOnBackPress : PropTypes . bool ,
164- } ;
165-
166- Modal . defaultProps = {
167- open : false ,
168- offset : 0 ,
169- overlayBackground : 'rgba(0, 0, 0, 0.75)' ,
170- animationDuration : 200 ,
171- animationTension : 40 ,
172- modalDidOpen : ( ) => undefined ,
173- modalDidClose : ( ) => undefined ,
174- closeOnTouchOutside : true ,
175- disableOnBackPress : false ,
176- } ;
177-
178-
179179const styles = StyleSheet . create ( {
180180 absolute : {
181181 position : 'absolute' ,
0 commit comments