From 85ffc3d2ba0cc82b7afba3723b066af1ee38955e Mon Sep 17 00:00:00 2001 From: Peter Schroeder Date: Sat, 31 Aug 2019 12:22:49 -0700 Subject: [PATCH] Allow openOverlay and closeOverlay animation duration to be configured via props, still defaulting to 500ms --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2b80ced..fe5f072 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,7 @@ var iface = { downsampling: PropTypes.number, blurStyle: PropTypes.string, vibrant: PropTypes.bool, + animationDuration: PropTypes.number } }; var RCTSajjadBlurOverlay = Platform.select({ @@ -38,7 +39,7 @@ export default class BlurOverlay extends React.Component { this.state.fadeIn, { toValue: 1, - duration: 500, + duration: this.props.animationDuration ? this.props.animationDuration : 500, useNativeDriver: true } ).start(); @@ -49,7 +50,7 @@ export default class BlurOverlay extends React.Component { this.state.fadeIn, { toValue: 0, - duration: 500, + duration: this.props.animationDuration ? this.props.animationDuration : 500, useNativeDriver: true } ).start(()=>this.setState({showBlurOverlay: false}));