react-native-lightbox
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -14,3 +14,5 @@ import React, { Component, Children, cloneElement } from 'react'; | ||
backgroundColor: PropTypes.string, | ||
didOpen: PropTypes.func, | ||
onOpen: PropTypes.func, | ||
willClose: PropTypes.func, | ||
onClose: PropTypes.func, | ||
@@ -27,2 +29,4 @@ springConfig: PropTypes.shape({ | ||
onOpen: () => {}, | ||
didOpen: () => {}, | ||
willClose: () => {}, | ||
onClose: () => {}, | ||
@@ -62,2 +66,4 @@ }; | ||
children: this.getContent(), | ||
didOpen: this.props.didOpen, | ||
willClose: this.props.willClose, | ||
onClose: this.onClose, | ||
@@ -80,2 +86,3 @@ }) | ||
}, () => { | ||
this.props.didOpen(); | ||
if(this.props.navigator) { | ||
@@ -82,0 +89,0 @@ const route = { |
@@ -66,2 +66,3 @@ import React, { Component } from 'react'; | ||
onClose: PropTypes.func, | ||
willClose: PropTypes.func, | ||
swipeToDismiss: PropTypes.bool, | ||
@@ -148,6 +149,10 @@ }; | ||
{ toValue: 1, ...this.props.springConfig } | ||
).start(() => this.setState({ isAnimating: false })); | ||
).start(() => { | ||
this.setState({ isAnimating: false }); | ||
this.props.didOpen(); | ||
}); | ||
} | ||
close = () => { | ||
this.props.willClose(); | ||
if(isIOS) { | ||
@@ -154,0 +159,0 @@ StatusBar.setHidden(false, 'fade'); |
{ | ||
"name": "react-native-lightbox", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "Images etc in Full Screen Lightbox Popovers for React Native", | ||
@@ -5,0 +5,0 @@ "main": "Lightbox.js", |
@@ -28,3 +28,3 @@ # react-native-lightbox | ||
For android support you must pass a reference to a `Navigator` since it does not yet have the `Modal` component and is not on the official todo list. See the `Example` project for a complete example. | ||
For android support you must pass a reference to a `Navigator` since it does not yet have the `Modal` component and is not on the official todo list. See the `Example` project for a complete example. | ||
@@ -59,4 +59,6 @@ ```js | ||
|**`renderContent`**|`function`|Custom lightbox content instead of default child content| | ||
|**`willClose`**|`function`|Triggered before lightbox is closed| | ||
|**`onClose`**|`function`|Triggered when lightbox is closed| | ||
|**`onOpen`**|`function`|Triggered when lightbox is opened| | ||
|**`didOpen`**|`function`|Triggered after lightbox is opened| | ||
|**`underlayColor`**|`string`|Color of touchable background, defaults to `black`| | ||
@@ -71,5 +73,5 @@ |**`backgroundColor`**|`string`|Color of lightbox background, defaults to `black`| | ||
## Example | ||
## Example | ||
Check full example in the `Example` folder. | ||
Check full example in the `Example` folder. | ||
@@ -76,0 +78,0 @@ ## License |
15048
360
78