From b0ef2e49e77f6af554f64a8b749ce45168fbf349 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Wed, 1 Dec 2021 12:33:14 +0500 Subject: [PATCH] update bouncing view --- .../src/components/ActionSheetComponent/BouncingView.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/components/ActionSheetComponent/BouncingView.js b/apps/mobile/src/components/ActionSheetComponent/BouncingView.js index d2cddfc81..08fbf5994 100644 --- a/apps/mobile/src/components/ActionSheetComponent/BouncingView.js +++ b/apps/mobile/src/components/ActionSheetComponent/BouncingView.js @@ -5,13 +5,14 @@ export const BouncingView = ({ children, style, duration = 600, - animated = true + animated = true, + initialScale = 0.9 }) => { - const scale = Animated.useValue(!animated ? 1 : 0.9); + const scale = Animated.useValue(!animated ? 1 : initialScale); useEffect(() => { if (!animated) return; - scale.setValue(0.9); + scale.setValue(initialScale); timing(scale, { toValue: 1, duration: duration, @@ -19,7 +20,7 @@ export const BouncingView = ({ }).start(); return () => { if (!animated) return; - scale.setValue(0.9); + scale.setValue(initialScale); }; }, []);