Bluesky app fork with some witchin' additions 💫

[APP-1291] prevent GestureActionView from hijacking swipe in a direction which no actions are specified (#8705)

Co-authored-by: hailey <hailey@blueskyweb.xyz>

authored by

Elijah Seed-Arita
hailey
and committed by
GitHub
6a7b8a27 3ae3ed24

+10 -5
+10 -5
src/lib/custom-animations/GestureActionView.tsx
··· 1 1 import React from 'react' 2 - import {ColorValue, Dimensions, StyleSheet, View} from 'react-native' 2 + import {type ColorValue, Dimensions, StyleSheet, View} from 'react-native' 3 3 import {Gesture, GestureDetector} from 'react-native-gesture-handler' 4 4 import Animated, { 5 5 clamp, ··· 114 114 }, 115 115 ) 116 116 117 + // NOTE(haileyok): 118 + // Absurdly high value so it doesn't interfere with the pan gestures above (i.e., scroll) 119 + // reanimated doesn't offer great support for disabling y/x axes :/ 120 + const effectivelyDisabledOffset = 200 117 121 const panGesture = Gesture.Pan() 118 - .activeOffsetX([-10, 10]) 119 - // Absurdly high value so it doesn't interfere with the pan gestures above (i.e., scroll) 120 - // reanimated doesn't offer great support for disabling y/x axes :/ 121 - .activeOffsetY([-200, 200]) 122 + .activeOffsetX([ 123 + actions.leftFirst ? -10 : -effectivelyDisabledOffset, 124 + actions.rightFirst ? 10 : effectivelyDisabledOffset, 125 + ]) 126 + .activeOffsetY([-effectivelyDisabledOffset, effectivelyDisabledOffset]) 122 127 .onStart(() => { 123 128 'worklet' 124 129 isActive.set(true)