From a7b0242cc8aaf09273abe20903e88e59a4acd1a7 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 20 May 2024 18:56:44 -0500 Subject: [🐴] Empty chat prompt (#4132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add empty chat pill * Tweak padding * move to `components`, place inside `KeyboardStickyView` * cleanup unused vars * add a new animation type * (unrelated) add haptic to long press * adjust shrink and pop --------- Co-authored-by: Hailey --- src/lib/custom-animations/ShrinkAndPop.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/lib/custom-animations/ShrinkAndPop.ts (limited to 'src/lib/custom-animations') diff --git a/src/lib/custom-animations/ShrinkAndPop.ts b/src/lib/custom-animations/ShrinkAndPop.ts new file mode 100644 index 000000000..ea2386c14 --- /dev/null +++ b/src/lib/custom-animations/ShrinkAndPop.ts @@ -0,0 +1,27 @@ +import {withDelay, withSequence, withTiming} from 'react-native-reanimated' + +export function ShrinkAndPop() { + 'worklet' + + const animations = { + opacity: withDelay(125, withTiming(0, {duration: 125})), + transform: [ + { + scale: withSequence( + withTiming(0.7, {duration: 75}), + withTiming(1.1, {duration: 150}), + ), + }, + ], + } + + const initialValues = { + opacity: 1, + transform: [{scale: 1}], + } + + return { + animations, + initialValues, + } +} -- cgit 1.4.1