-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate drawer to new RNGH API (#11776)
This PR moves the drawer to the new API. https://github.com/react-navigation/react-navigation/assets/25709300/bb3714e0-fadc-44c2-bcf4-f9f21510071d --------- Co-authored-by: Satyajit Sahoo <satyajit.happy@gmail.com>
- Loading branch information
Showing
9 changed files
with
61 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export { DrawerGestureContext } from './utils/DrawerGestureContext'; | ||
export { DrawerProgressContext } from './utils/DrawerProgressContext'; | ||
export { useDrawerProgress } from './utils/useDrawerProgress'; | ||
export { Drawer } from './views/Drawer'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 0 additions & 4 deletions
4
packages/react-native-drawer-layout/src/utils/DrawerGestureContext.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 2 additions & 19 deletions
21
packages/react-native-drawer-layout/src/views/GestureHandlerNative.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
import * as React from 'react'; | ||
import { | ||
PanGestureHandler as PanGestureHandlerNative, | ||
type PanGestureHandlerProperties, | ||
} from 'react-native-gesture-handler'; | ||
|
||
import { DrawerGestureContext } from '../utils/DrawerGestureContext'; | ||
|
||
export function PanGestureHandler(props: PanGestureHandlerProperties) { | ||
const gestureRef = React.useRef<PanGestureHandlerNative>(null); | ||
|
||
return ( | ||
<DrawerGestureContext.Provider value={gestureRef}> | ||
<PanGestureHandlerNative {...props} /> | ||
</DrawerGestureContext.Provider> | ||
); | ||
} | ||
|
||
export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; | ||
export { | ||
Gesture, | ||
GestureDetector, | ||
GestureHandlerRootView, | ||
State as GestureState, | ||
TapGestureHandler, | ||
} from 'react-native-gesture-handler'; |