@react-navigation/drawer 6.6.2 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +24 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +8 -49
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +3 -3
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +2 -3
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +3 -4
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +5 -6
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +6 -7
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +14 -10
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +9 -10
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +78 -73
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/module/index.js +11 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +5 -45
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js +1 -2
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js +2 -2
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +3 -3
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +3 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +15 -11
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +9 -9
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +1 -1
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +72 -67
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/typescript/src/index.d.ts +11 -13
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +9 -4
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +51 -16
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +11 -6
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItemList.d.ts +2 -2
- package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +2 -2
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +2 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/index.tsx +15 -13
- package/src/navigators/createDrawerNavigator.tsx +4 -74
- package/src/types.tsx +24 -3
- package/src/utils/DrawerPositionContext.tsx +3 -1
- package/src/utils/DrawerStatusContext.tsx +3 -5
- package/src/utils/getDrawerStatusFromState.tsx +1 -1
- package/src/utils/useDrawerStatus.tsx +2 -2
- package/src/views/DrawerContent.tsx +3 -3
- package/src/views/DrawerContentScrollView.tsx +5 -3
- package/src/views/DrawerItem.tsx +23 -20
- package/src/views/DrawerItemList.tsx +7 -10
- package/src/views/DrawerToggleButton.tsx +1 -1
- package/src/views/DrawerView.tsx +68 -78
- package/lib/commonjs/utils/DrawerGestureContext.js +0 -12
- package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
- package/lib/commonjs/utils/DrawerProgressContext.js +0 -12
- package/lib/commonjs/utils/DrawerProgressContext.js.map +0 -1
- package/lib/commonjs/utils/useDrawerProgress.js +0 -19
- package/lib/commonjs/utils/useDrawerProgress.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.android.js +0 -17
- package/lib/commonjs/views/GestureHandler.android.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.ios.js +0 -17
- package/lib/commonjs/views/GestureHandler.ios.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.js +0 -32
- package/lib/commonjs/views/GestureHandler.js.map +0 -1
- package/lib/commonjs/views/GestureHandlerNative.js +0 -37
- package/lib/commonjs/views/GestureHandlerNative.js.map +0 -1
- package/lib/commonjs/views/legacy/Drawer.js +0 -438
- package/lib/commonjs/views/legacy/Drawer.js.map +0 -1
- package/lib/commonjs/views/legacy/Overlay.js +0 -74
- package/lib/commonjs/views/legacy/Overlay.js.map +0 -1
- package/lib/commonjs/views/modern/Drawer.js +0 -304
- package/lib/commonjs/views/modern/Drawer.js.map +0 -1
- package/lib/commonjs/views/modern/Overlay.js +0 -69
- package/lib/commonjs/views/modern/Overlay.js.map +0 -1
- package/lib/module/utils/DrawerGestureContext.js +0 -3
- package/lib/module/utils/DrawerGestureContext.js.map +0 -1
- package/lib/module/utils/DrawerProgressContext.js +0 -3
- package/lib/module/utils/DrawerProgressContext.js.map +0 -1
- package/lib/module/utils/useDrawerProgress.js +0 -10
- package/lib/module/utils/useDrawerProgress.js.map +0 -1
- package/lib/module/views/GestureHandler.android.js +0 -2
- package/lib/module/views/GestureHandler.android.js.map +0 -1
- package/lib/module/views/GestureHandler.ios.js +0 -2
- package/lib/module/views/GestureHandler.ios.js.map +0 -1
- package/lib/module/views/GestureHandler.js +0 -20
- package/lib/module/views/GestureHandler.js.map +0 -1
- package/lib/module/views/GestureHandlerNative.js +0 -11
- package/lib/module/views/GestureHandlerNative.js.map +0 -1
- package/lib/module/views/legacy/Drawer.js +0 -428
- package/lib/module/views/legacy/Drawer.js.map +0 -1
- package/lib/module/views/legacy/Overlay.js +0 -64
- package/lib/module/views/legacy/Overlay.js.map +0 -1
- package/lib/module/views/modern/Drawer.js +0 -295
- package/lib/module/views/modern/Drawer.js.map +0 -1
- package/lib/module/views/modern/Overlay.js +0 -60
- package/lib/module/views/modern/Overlay.js.map +0 -1
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -4
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts +0 -5
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/useDrawerProgress.d.ts +0 -3
- package/lib/typescript/src/utils/useDrawerProgress.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.android.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.d.ts +0 -15
- package/lib/typescript/src/views/GestureHandler.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +0 -6
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Drawer.d.ts +0 -45
- package/lib/typescript/src/views/legacy/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/legacy/Overlay.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Drawer.d.ts +0 -4
- package/lib/typescript/src/views/modern/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/modern/Overlay.d.ts.map +0 -1
- package/src/utils/DrawerGestureContext.tsx +0 -3
- package/src/utils/DrawerProgressContext.tsx +0 -6
- package/src/utils/useDrawerProgress.tsx +0 -18
- package/src/views/GestureHandler.android.tsx +0 -1
- package/src/views/GestureHandler.ios.tsx +0 -1
- package/src/views/GestureHandler.tsx +0 -29
- package/src/views/GestureHandlerNative.tsx +0 -24
- package/src/views/legacy/Drawer.tsx +0 -672
- package/src/views/legacy/Overlay.tsx +0 -87
- package/src/views/modern/Drawer.tsx +0 -425
- package/src/views/modern/Overlay.tsx +0 -82
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerPositionContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerPositionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC
|
|
1
|
+
{"version":3,"file":"DrawerPositionContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerPositionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,qBAAqB,6CAEtB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
declare const DrawerStatusContext: React.Context<DrawerStatus | undefined>;
|
|
4
|
-
export default DrawerStatusContext;
|
|
3
|
+
export declare const DrawerStatusContext: React.Context<DrawerStatus | undefined>;
|
|
5
4
|
//# sourceMappingURL=DrawerStatusContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerStatusContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerStatusContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,
|
|
1
|
+
{"version":3,"file":"DrawerStatusContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerStatusContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,mBAAmB,yCAEpB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
|
|
2
|
-
export
|
|
2
|
+
export declare function getDrawerStatusFromState(state: DrawerNavigationState<ParamListBase>): DrawerStatus;
|
|
3
3
|
//# sourceMappingURL=getDrawerStatusFromState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDrawerStatusFromState.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDrawerStatusFromState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,
|
|
1
|
+
{"version":3,"file":"getDrawerStatusFromState.d.ts","sourceRoot":"","sources":["../../../../src/utils/getDrawerStatusFromState.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,GAC1C,YAAY,CAYd"}
|
|
@@ -3,5 +3,5 @@ import type { DrawerStatus } from '@react-navigation/native';
|
|
|
3
3
|
* Hook to detect if the drawer's status in a parent navigator.
|
|
4
4
|
* Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
6
|
+
export declare function useDrawerStatus(): DrawerStatus;
|
|
7
7
|
//# sourceMappingURL=useDrawerStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDrawerStatus.d.ts","sourceRoot":"","sources":["../../../../src/utils/useDrawerStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"useDrawerStatus.d.ts","sourceRoot":"","sources":["../../../../src/utils/useDrawerStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAU9C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DrawerContentComponentProps } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): JSX.Element;
|
|
4
4
|
//# sourceMappingURL=DrawerContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,
|
|
1
|
+
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,eAgB7B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScrollView, ScrollViewProps } from 'react-native';
|
|
3
|
-
declare const
|
|
3
|
+
export declare const DrawerContentScrollView: React.ForwardRefExoticComponent<ScrollViewProps & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
} & React.RefAttributes<ScrollView>>;
|
|
6
|
-
export default _default;
|
|
7
6
|
//# sourceMappingURL=DrawerContentScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,eAAe,EAEhB,MAAM,cAAc,CAAC
|
|
1
|
+
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,eAAe,EAEhB,MAAM,cAAc,CAAC;AAuCtB,eAAO,MAAM,uBAAuB;cAjCxB,MAAM,SAAS;oCAmC1B,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { Route } from '@react-navigation/native';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
-
|
|
4
|
+
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* The route object which should be specified by the drawer item.
|
|
7
|
+
*/
|
|
8
|
+
route: Route<string>;
|
|
9
|
+
/**
|
|
10
|
+
* The `href` to use for the anchor tag on web
|
|
11
|
+
*/
|
|
12
|
+
href?: string;
|
|
4
13
|
/**
|
|
5
14
|
* The label text of the item.
|
|
6
15
|
*/
|
|
@@ -16,10 +25,6 @@ declare type Props = {
|
|
|
16
25
|
size: number;
|
|
17
26
|
color: string;
|
|
18
27
|
}) => React.ReactNode;
|
|
19
|
-
/**
|
|
20
|
-
* URL to use for the link to the tab.
|
|
21
|
-
*/
|
|
22
|
-
to?: string;
|
|
23
28
|
/**
|
|
24
29
|
* Whether to highlight the drawer item as active.
|
|
25
30
|
*/
|
|
@@ -82,6 +87,6 @@ declare type Props = {
|
|
|
82
87
|
/**
|
|
83
88
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
84
89
|
*/
|
|
85
|
-
export
|
|
90
|
+
export declare function DrawerItem(props: Props): JSX.Element;
|
|
86
91
|
export {};
|
|
87
92
|
//# sourceMappingURL=DrawerItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,SAAS,EAGT,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EACD,MAAM,GACN,CAAC,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IACtE;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;QACb,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,KAAK,CAAC,SAAS,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AA6DF;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,eA0EtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DrawerNavigationState, ParamListBase } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { DrawerDescriptorMap, DrawerNavigationHelpers } from '../types';
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
state: DrawerNavigationState<ParamListBase>;
|
|
6
6
|
navigation: DrawerNavigationHelpers;
|
|
7
7
|
descriptors: DrawerDescriptorMap;
|
|
@@ -9,6 +9,6 @@ declare type Props = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Component that renders the navigation list in the drawer.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export declare function DrawerItemList({ state, navigation, descriptors }: Props): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=DrawerItemList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG7E,
|
|
1
|
+
{"version":3,"file":"DrawerItemList.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItemList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAG7E,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,KAAK,sEAoEvE"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
type Props = {
|
|
3
3
|
accessibilityLabel?: string;
|
|
4
4
|
pressColor?: string;
|
|
5
5
|
pressOpacity?: number;
|
|
6
6
|
tintColor?: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export declare function DrawerToggleButton({ tintColor, ...rest }: Props): JSX.Element;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=DrawerToggleButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":";AAWA,KAAK,KAAK,GAAG;IACX,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAuB/D"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DrawerNavigationState, DrawerStatus, ParamListBase } from '@react-navigation/native';
|
|
3
3
|
import type { DrawerDescriptorMap, DrawerNavigationConfig, DrawerNavigationHelpers } from '../types';
|
|
4
|
-
|
|
4
|
+
type Props = DrawerNavigationConfig & {
|
|
5
5
|
defaultStatus: DrawerStatus;
|
|
6
6
|
state: DrawerNavigationState<ParamListBase>;
|
|
7
7
|
navigation: DrawerNavigationHelpers;
|
|
8
8
|
descriptors: DrawerDescriptorMap;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export declare function DrawerView({ navigation, ...rest }: Props): JSX.Element;
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=DrawerView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":";AAMA,OAAO,EAEL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EAEd,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":";AAMA,OAAO,EAEL,qBAAqB,EACrB,YAAY,EACZ,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AAQlB,KAAK,KAAK,GAAG,sBAAsB,GAAG;IACpC,aAAa,EAAE,YAAY,CAAC;IAC5B,KAAK,EAAE,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC5C,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,mBAAmB,CAAC;CAClC,CAAC;AAwRF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAMxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,
|
|
1
|
+
{"version":3,"file":"ScreenFallback.d.ts","sourceRoot":"","sources":["../../../../src/views/ScreenFallback.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAQ,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC;AAUF,eAAO,MAAM,oBAAoB;aAItB,OAAO;kBACF,OAAO;cACX,MAAM,SAAS;iBAO1B,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,eAchE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/drawer",
|
|
3
3
|
"description": "Drawer navigator component with animated transitions and gesturess",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-alpha.1",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -41,24 +41,25 @@
|
|
|
41
41
|
"clean": "del lib"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@react-navigation/elements": "^1.
|
|
44
|
+
"@react-navigation/elements": "^1.4.0-alpha.0",
|
|
45
45
|
"color": "^4.2.3",
|
|
46
|
-
"
|
|
46
|
+
"react-native-drawer-layout": "^3.2.0",
|
|
47
|
+
"use-latest-callback": "^0.1.5"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"@react-navigation/native": "^
|
|
50
|
+
"@react-navigation/native": "^7.0.0-alpha.1",
|
|
50
51
|
"@testing-library/react-native": "^11.5.0",
|
|
51
|
-
"@types/react": "~18.0.
|
|
52
|
-
"@types/react-native": "~0.
|
|
53
|
-
"del-cli": "^
|
|
54
|
-
"react": "18.
|
|
55
|
-
"react-native": "0.
|
|
52
|
+
"@types/react": "~18.0.26",
|
|
53
|
+
"@types/react-native": "~0.70.8",
|
|
54
|
+
"del-cli": "^5.0.0",
|
|
55
|
+
"react": "18.1.0",
|
|
56
|
+
"react-native": "0.70.5",
|
|
56
57
|
"react-native-builder-bob": "^0.20.4",
|
|
57
|
-
"react-native-gesture-handler": "~2.
|
|
58
|
+
"react-native-gesture-handler": "~2.8.0",
|
|
58
59
|
"react-native-reanimated": "~2.9.1",
|
|
59
|
-
"react-native-safe-area-context": "4.
|
|
60
|
-
"react-native-screens": "~3.
|
|
61
|
-
"typescript": "^4.
|
|
60
|
+
"react-native-safe-area-context": "4.4.1",
|
|
61
|
+
"react-native-screens": "~3.18.0",
|
|
62
|
+
"typescript": "^4.9.4"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
65
|
"@react-navigation/native": "^6.0.0",
|
|
@@ -83,5 +84,5 @@
|
|
|
83
84
|
]
|
|
84
85
|
]
|
|
85
86
|
},
|
|
86
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "230c09deeeb886929a15cb4cdcb496372a9496e1"
|
|
87
88
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Navigators
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
4
|
+
export { createDrawerNavigator } from './navigators/createDrawerNavigator';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Views
|
|
8
8
|
*/
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
9
|
+
export { DrawerContent } from './views/DrawerContent';
|
|
10
|
+
export { DrawerContentScrollView } from './views/DrawerContentScrollView';
|
|
11
|
+
export { DrawerItem } from './views/DrawerItem';
|
|
12
|
+
export { DrawerItemList } from './views/DrawerItemList';
|
|
13
|
+
export { DrawerToggleButton } from './views/DrawerToggleButton';
|
|
14
|
+
export { DrawerView } from './views/DrawerView';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Utilities
|
|
18
18
|
*/
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
export { DrawerStatusContext } from './utils/DrawerStatusContext';
|
|
20
|
+
export { getDrawerStatusFromState } from './utils/getDrawerStatusFromState';
|
|
21
|
+
export { useDrawerStatus } from './utils/useDrawerStatus';
|
|
22
|
+
export {
|
|
23
|
+
DrawerGestureContext,
|
|
24
|
+
DrawerProgressContext,
|
|
25
|
+
useDrawerProgress,
|
|
26
|
+
} from 'react-native-drawer-layout';
|
|
25
27
|
|
|
26
28
|
/**
|
|
27
29
|
* Types
|
|
@@ -5,19 +5,17 @@ import {
|
|
|
5
5
|
DrawerNavigationState,
|
|
6
6
|
DrawerRouter,
|
|
7
7
|
DrawerRouterOptions,
|
|
8
|
-
DrawerStatus,
|
|
9
8
|
ParamListBase,
|
|
10
9
|
useNavigationBuilder,
|
|
11
10
|
} from '@react-navigation/native';
|
|
12
11
|
import * as React from 'react';
|
|
13
|
-
import warnOnce from 'warn-once';
|
|
14
12
|
|
|
15
13
|
import type {
|
|
16
14
|
DrawerNavigationConfig,
|
|
17
15
|
DrawerNavigationEventMap,
|
|
18
16
|
DrawerNavigationOptions,
|
|
19
17
|
} from '../types';
|
|
20
|
-
import DrawerView from '../views/DrawerView';
|
|
18
|
+
import { DrawerView } from '../views/DrawerView';
|
|
21
19
|
|
|
22
20
|
type Props = DefaultNavigatorOptions<
|
|
23
21
|
ParamListBase,
|
|
@@ -31,80 +29,13 @@ type Props = DefaultNavigatorOptions<
|
|
|
31
29
|
function DrawerNavigator({
|
|
32
30
|
id,
|
|
33
31
|
initialRouteName,
|
|
34
|
-
defaultStatus
|
|
32
|
+
defaultStatus = 'closed',
|
|
35
33
|
backBehavior,
|
|
36
34
|
children,
|
|
37
35
|
screenListeners,
|
|
38
36
|
screenOptions,
|
|
39
|
-
...
|
|
37
|
+
...rest
|
|
40
38
|
}: Props) {
|
|
41
|
-
const {
|
|
42
|
-
// @ts-expect-error: openByDefault is deprecated
|
|
43
|
-
openByDefault,
|
|
44
|
-
// @ts-expect-error: lazy is deprecated
|
|
45
|
-
lazy,
|
|
46
|
-
// @ts-expect-error: drawerContentOptions is deprecated
|
|
47
|
-
drawerContentOptions,
|
|
48
|
-
...rest
|
|
49
|
-
} = restWithDeprecated;
|
|
50
|
-
|
|
51
|
-
let defaultScreenOptions: DrawerNavigationOptions = {};
|
|
52
|
-
|
|
53
|
-
if (drawerContentOptions) {
|
|
54
|
-
Object.assign(defaultScreenOptions, {
|
|
55
|
-
drawerPosition: drawerContentOptions.drawerPosition,
|
|
56
|
-
drawerType: drawerContentOptions.drawerType,
|
|
57
|
-
swipeEdgeWidth: drawerContentOptions.edgeWidth,
|
|
58
|
-
drawerHideStatusBarOnOpen: drawerContentOptions.hideStatusBar,
|
|
59
|
-
keyboardDismissMode: drawerContentOptions.keyboardDismissMode,
|
|
60
|
-
swipeMinDistance: drawerContentOptions.minSwipeDistance,
|
|
61
|
-
overlayColor: drawerContentOptions.overlayColor,
|
|
62
|
-
drawerStatusBarAnimation: drawerContentOptions.statusBarAnimation,
|
|
63
|
-
gestureHandlerProps: drawerContentOptions.gestureHandlerProps,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
(
|
|
67
|
-
Object.keys(defaultScreenOptions) as (keyof DrawerNavigationOptions)[]
|
|
68
|
-
).forEach((key) => {
|
|
69
|
-
if (defaultScreenOptions[key] === undefined) {
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
71
|
-
delete defaultScreenOptions[key];
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
warnOnce(
|
|
76
|
-
drawerContentOptions,
|
|
77
|
-
`Drawer Navigator: 'drawerContentOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(
|
|
78
|
-
defaultScreenOptions,
|
|
79
|
-
null,
|
|
80
|
-
2
|
|
81
|
-
)}\n\nSee https://reactnavigation.org/docs/drawer-navigator#options for more details.`
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (typeof lazy === 'boolean') {
|
|
86
|
-
defaultScreenOptions.lazy = lazy;
|
|
87
|
-
|
|
88
|
-
warnOnce(
|
|
89
|
-
true,
|
|
90
|
-
`Drawer Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/drawer-navigator/#lazy for more details.`
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (typeof openByDefault === 'boolean') {
|
|
95
|
-
warnOnce(
|
|
96
|
-
true,
|
|
97
|
-
`Drawer Navigator: 'openByDefault' is deprecated. Use 'defaultStatus' and set it to 'open' or 'closed' instead.\n\nSee https://reactnavigation.org/docs/drawer-navigator/#defaultstatus for more details.`
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const defaultStatus: DrawerStatus =
|
|
102
|
-
customDefaultStatus !== undefined
|
|
103
|
-
? customDefaultStatus
|
|
104
|
-
: openByDefault
|
|
105
|
-
? 'open'
|
|
106
|
-
: 'closed';
|
|
107
|
-
|
|
108
39
|
const { state, descriptors, navigation, NavigationContent } =
|
|
109
40
|
useNavigationBuilder<
|
|
110
41
|
DrawerNavigationState<ParamListBase>,
|
|
@@ -120,7 +51,6 @@ function DrawerNavigator({
|
|
|
120
51
|
children,
|
|
121
52
|
screenListeners,
|
|
122
53
|
screenOptions,
|
|
123
|
-
defaultScreenOptions,
|
|
124
54
|
});
|
|
125
55
|
|
|
126
56
|
return (
|
|
@@ -136,7 +66,7 @@ function DrawerNavigator({
|
|
|
136
66
|
);
|
|
137
67
|
}
|
|
138
68
|
|
|
139
|
-
export
|
|
69
|
+
export const createDrawerNavigator = createNavigatorFactory<
|
|
140
70
|
DrawerNavigationState<ParamListBase>,
|
|
141
71
|
DrawerNavigationOptions,
|
|
142
72
|
DrawerNavigationEventMap,
|
package/src/types.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export type DrawerNavigationConfig = {
|
|
|
38
38
|
/**
|
|
39
39
|
* Whether to use the legacy implementation based on Reanimated 1.
|
|
40
40
|
* The new implementation based on Reanimated 2 will perform better,
|
|
41
|
-
* but
|
|
41
|
+
* but it's not possible to use Chrome remote debugger.
|
|
42
42
|
*
|
|
43
43
|
* This defaults to `true` if Reanimated 2 is not configured.
|
|
44
44
|
*
|
|
@@ -172,8 +172,9 @@ export type DrawerNavigationOptions = HeaderOptions & {
|
|
|
172
172
|
overlayColor?: string;
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
176
|
-
*
|
|
175
|
+
* Accessibility label for the overlay. This is read by the screen reader when the user taps the overlay.
|
|
176
|
+
* Defaults to "Close drawer".
|
|
177
|
+
*/
|
|
177
178
|
overlayAccessibilityLabel?: string;
|
|
178
179
|
|
|
179
180
|
/**
|
|
@@ -257,6 +258,26 @@ export type DrawerNavigationEventMap = {
|
|
|
257
258
|
* Event which fires on tapping on the item in the drawer menu.
|
|
258
259
|
*/
|
|
259
260
|
drawerItemPress: { data: undefined; canPreventDefault: true };
|
|
261
|
+
/**
|
|
262
|
+
* Event which fires when a transition animation starts.
|
|
263
|
+
*/
|
|
264
|
+
transitionStart: { data: { closing: boolean } };
|
|
265
|
+
/**
|
|
266
|
+
* Event which fires when a transition animation ends.
|
|
267
|
+
*/
|
|
268
|
+
transitionEnd: { data: { closing: boolean } };
|
|
269
|
+
/**
|
|
270
|
+
* Event which fires when navigation gesture starts.
|
|
271
|
+
*/
|
|
272
|
+
gestureStart: { data: undefined };
|
|
273
|
+
/**
|
|
274
|
+
* Event which fires when navigation gesture is completed.
|
|
275
|
+
*/
|
|
276
|
+
gestureEnd: { data: undefined };
|
|
277
|
+
/**
|
|
278
|
+
* Event which fires when navigation gesture is canceled.
|
|
279
|
+
*/
|
|
280
|
+
gestureCancel: { data: undefined };
|
|
260
281
|
};
|
|
261
282
|
|
|
262
283
|
export type DrawerNavigationHelpers = NavigationHelpers<
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
const DrawerStatusContext = React.createContext<
|
|
5
|
-
undefined
|
|
6
|
-
);
|
|
7
|
-
|
|
8
|
-
export default DrawerStatusContext;
|
|
4
|
+
export const DrawerStatusContext = React.createContext<
|
|
5
|
+
DrawerStatus | undefined
|
|
6
|
+
>(undefined);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DrawerStatus } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import DrawerStatusContext from './DrawerStatusContext';
|
|
4
|
+
import { DrawerStatusContext } from './DrawerStatusContext';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hook to detect if the drawer's status in a parent navigator.
|
|
8
8
|
* Returns 'open' if the drawer is open, 'closed' if the drawer is closed.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export function useDrawerStatus(): DrawerStatus {
|
|
11
11
|
const drawerStatus = React.useContext(DrawerStatusContext);
|
|
12
12
|
|
|
13
13
|
if (drawerStatus === undefined) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import type { DrawerContentComponentProps } from '../types';
|
|
4
|
-
import DrawerContentScrollView from './DrawerContentScrollView';
|
|
5
|
-
import DrawerItemList from './DrawerItemList';
|
|
4
|
+
import { DrawerContentScrollView } from './DrawerContentScrollView';
|
|
5
|
+
import { DrawerItemList } from './DrawerItemList';
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function DrawerContent({
|
|
8
8
|
descriptors,
|
|
9
9
|
state,
|
|
10
10
|
...rest
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
} from 'react-native';
|
|
8
8
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
9
9
|
|
|
10
|
-
import DrawerPositionContext from '../utils/DrawerPositionContext';
|
|
10
|
+
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
11
11
|
|
|
12
12
|
type Props = ScrollViewProps & {
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
function
|
|
16
|
+
function DrawerContentScrollViewInner(
|
|
17
17
|
{ contentContainerStyle, style, children, ...rest }: Props,
|
|
18
18
|
ref?: React.Ref<ScrollView>
|
|
19
19
|
) {
|
|
@@ -43,7 +43,9 @@ function DrawerContentScrollView(
|
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export
|
|
46
|
+
export const DrawerContentScrollView = React.forwardRef(
|
|
47
|
+
DrawerContentScrollViewInner
|
|
48
|
+
);
|
|
47
49
|
|
|
48
50
|
const styles = StyleSheet.create({
|
|
49
51
|
container: {
|