File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/components/floatingButton Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ const gradientImage = () => require('./gradient.png');
54
54
class FloatingButton extends PureComponent < FloatingButtonProps > {
55
55
static displayName = 'FloatingButton' ;
56
56
57
+ static defaultProps = {
58
+ duration : 300
59
+ } ;
60
+
57
61
initialVisibility ?: boolean ;
58
62
firstLoad : boolean ;
59
63
visibleAnimated : Animated . Value ;
@@ -67,10 +71,12 @@ class FloatingButton extends PureComponent<FloatingButtonProps> {
67
71
}
68
72
69
73
componentDidUpdate ( prevProps : FloatingButtonProps ) {
70
- if ( prevProps . visible !== this . props . visible ) {
74
+ const { visible, duration} = this . props ;
75
+
76
+ if ( prevProps . visible !== visible ) {
71
77
Animated . timing ( this . visibleAnimated , {
72
- toValue : Number ( ! ! this . props . visible ) ,
73
- duration : 300 ,
78
+ toValue : Number ( ! ! visible ) ,
79
+ duration,
74
80
useNativeDriver : true
75
81
} ) . start ( ) ;
76
82
}
You can’t perform that action at this time.
0 commit comments