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

* Block drawer when scrolling interstitials
2025-01-17 01:17:13 +00: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>
}