Rm unused trending scroll gesture
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
import {useCallback, useEffect, useState} from 'react'
|
import {useCallback, useEffect} from 'react'
|
||||||
import {BackHandler, useWindowDimensions, View} from 'react-native'
|
import {BackHandler, useWindowDimensions, View} from 'react-native'
|
||||||
import {Drawer} from 'react-native-drawer-layout'
|
import {Drawer} from 'react-native-drawer-layout'
|
||||||
import {SystemBars} from 'react-native-edge-to-edge'
|
import {SystemBars} from 'react-native-edge-to-edge'
|
||||||
import {Gesture} from 'react-native-gesture-handler'
|
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {useNavigation, useNavigationState} from '@react-navigation/native'
|
import {useNavigation, useNavigationState} from '@react-navigation/native'
|
||||||
|
|
||||||
@@ -143,7 +142,6 @@ function DrawerLayout({children}: {children: React.ReactNode}) {
|
|||||||
const {hasSession} = useSession()
|
const {hasSession} = useSession()
|
||||||
|
|
||||||
const swipeEnabled = !canGoBack && hasSession && !isDrawerSwipeDisabled
|
const swipeEnabled = !canGoBack && hasSession && !isDrawerSwipeDisabled
|
||||||
const [trendingScrollGesture] = useState(() => Gesture.Native())
|
|
||||||
|
|
||||||
const renderDrawerContent = useCallback(() => <DrawerContent />, [])
|
const renderDrawerContent = useCallback(() => <DrawerContent />, [])
|
||||||
const onOpenDrawer = useCallback(
|
const onOpenDrawer = useCallback(
|
||||||
@@ -160,8 +158,6 @@ function DrawerLayout({children}: {children: React.ReactNode}) {
|
|||||||
renderDrawerContent={renderDrawerContent}
|
renderDrawerContent={renderDrawerContent}
|
||||||
drawerStyle={{width: Math.min(400, winDim.width * 0.8)}}
|
drawerStyle={{width: Math.min(400, winDim.width * 0.8)}}
|
||||||
configureGestureHandler={handler => {
|
configureGestureHandler={handler => {
|
||||||
handler = handler.requireExternalGestureToFail(trendingScrollGesture)
|
|
||||||
|
|
||||||
if (swipeEnabled) {
|
if (swipeEnabled) {
|
||||||
if (isDrawerOpen) {
|
if (isDrawerOpen) {
|
||||||
return handler.activeOffsetX([-1, 1])
|
return handler.activeOffsetX([-1, 1])
|
||||||
|
|||||||
Reference in New Issue
Block a user