Files
bsky-social-app/src/view/shell/BlockDrawerGesture.tsx
T
dan b0fdef4218 Prevent Drawer gesture conflicting with Suggestions scroll (#7468)
* Extract BlockDrawerGeesture

* Block drawer when scrolling interstitials

(cherry picked from commit 9e3f2f4374)
2025-01-17 17:51:53 -06:00

10 lines
498 B
TypeScript

import {useContext} from 'react'
import {DrawerGestureContext} from 'react-native-drawer-layout'
import {Gesture, GestureDetector} from 'react-native-gesture-handler'
export function BlockDrawerGesture({children}: {children: React.ReactNode}) {
const drawerGesture = useContext(DrawerGestureContext) ?? Gesture.Native() // noop for web
const scrollGesture = Gesture.Native().blocksExternalGesture(drawerGesture)
return <GestureDetector gesture={scrollGesture}>{children}</GestureDetector>
}