Bluesky app fork with some witchin' additions ๐Ÿ’ซ
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[๐Ÿด] Adjust press and hold delay on messages (#3918)

* adjust press and hold delay on messages

* adjust hit slop

authored by

Hailey and committed by
GitHub
f62b0458 701e508a

+7 -5
+7 -5
src/components/dms/ActionsWrapper.tsx
··· 1 - import React, {useCallback} from 'react' 1 + import React from 'react' 2 2 import {Keyboard, Pressable, View} from 'react-native' 3 3 import Animated, { 4 4 cancelAnimation, ··· 9 9 } from 'react-native-reanimated' 10 10 import {ChatBskyConvoDefs} from '@atproto-labs/api' 11 11 12 + import {HITSLOP_10} from 'lib/constants' 12 13 import {useHaptics} from 'lib/haptics' 13 14 import {atoms as a} from '#/alf' 14 15 import {MessageMenu} from '#/components/dms/MessageMenu' ··· 37 38 38 39 // Reanimated's `runOnJS` doesn't like refs, so we can't use `runOnJS(menuControl.open)()`. Instead, we'll use this 39 40 // function 40 - const open = useCallback(() => { 41 + const open = React.useCallback(() => { 41 42 Keyboard.dismiss() 42 43 menuControl.open() 43 44 }, [menuControl]) 44 45 45 - const shrink = useCallback(() => { 46 + const shrink = React.useCallback(() => { 46 47 'worklet' 47 48 cancelAnimation(scale) 48 49 scale.value = withTiming(1, {duration: 200}, () => { ··· 52 53 53 54 const grow = React.useCallback(() => { 54 55 'worklet' 55 - scale.value = withTiming(1.05, {duration: 750}, finished => { 56 + scale.value = withTiming(1.05, {duration: 450}, finished => { 56 57 if (!finished) return 57 58 animationDidComplete.value = true 58 59 runOnJS(playHaptic)() ··· 74 75 style={animatedStyle} 75 76 unstable_pressDelay={200} 76 77 onPressIn={grow} 77 - onTouchEnd={shrink}> 78 + onTouchEnd={shrink} 79 + hitSlop={HITSLOP_10}> 78 80 {children} 79 81 </AnimatedPressable> 80 82 <MessageMenu message={message} control={menuControl} hideTrigger={true} />