From 587c0c625752964d8ce64faf1d329dce3c834a5c Mon Sep 17 00:00:00 2001 From: Hailey Date: Fri, 27 Sep 2024 15:26:28 -0700 Subject: Rework native autocomplete (#5521) Co-authored-by: Samuel Newman --- src/lib/custom-animations/PressableScale.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/lib/custom-animations/PressableScale.tsx') diff --git a/src/lib/custom-animations/PressableScale.tsx b/src/lib/custom-animations/PressableScale.tsx index d6eabf8b2..ca080dc8a 100644 --- a/src/lib/custom-animations/PressableScale.tsx +++ b/src/lib/custom-animations/PressableScale.tsx @@ -13,17 +13,19 @@ import {isNative} from '#/platform/detection' const DEFAULT_TARGET_SCALE = isNative || isTouchDevice ? 0.98 : 1 +const AnimatedPressable = Animated.createAnimatedComponent(Pressable) + export function PressableScale({ targetScale = DEFAULT_TARGET_SCALE, children, - contentContainerStyle, + style, onPressIn, onPressOut, ...rest }: { targetScale?: number - contentContainerStyle?: StyleProp -} & Exclude) { + style?: StyleProp +} & Exclude) { const scale = useSharedValue(1) const animatedStyle = useAnimatedStyle(() => ({ @@ -31,7 +33,7 @@ export function PressableScale({ })) return ( - { 'worklet' @@ -49,10 +51,9 @@ export function PressableScale({ cancelAnimation(scale) scale.value = withTiming(1, {duration: 100}) }} + style={[animatedStyle, style]} {...rest}> - - {children as React.ReactNode} - - + {children} + ) } -- cgit 1.4.1