@react-navigation/drawer 7.0.0-rc.2 → 7.0.0-rc.21
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 +10 -10
- package/lib/commonjs/navigators/createDrawerNavigator.js +11 -11
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/utils/useDrawerStatus.js +1 -1
- package/lib/commonjs/views/DrawerContent.js +12 -12
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +12 -9
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +44 -38
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +4 -4
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +14 -13
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +126 -113
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/commonjs/views/ScreenFallback.js +18 -11
- package/lib/commonjs/views/ScreenFallback.js.map +1 -1
- package/lib/module/index.js +10 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +11 -9
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/utils/useDrawerStatus.js +1 -1
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +12 -10
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +12 -9
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +44 -38
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +4 -4
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +13 -11
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +126 -113
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/module/views/ScreenFallback.js +18 -11
- package/lib/module/views/ScreenFallback.js.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +2 -3
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +2 -2
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +1 -2
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +2 -2
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/package.json +32 -16
- package/src/navigators/createDrawerNavigator.tsx +1 -4
- package/src/views/DrawerContent.tsx +0 -2
- package/src/views/DrawerContentScrollView.tsx +6 -4
- package/src/views/DrawerItem.tsx +5 -6
- package/src/views/DrawerToggleButton.tsx +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ResourceSavingView","React","View","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","
|
|
1
|
+
{"version":3,"names":["ResourceSavingView","React","View","jsx","_jsx","Screens","require","e","MaybeScreenContainer","enabled","rest","screensEnabled","ScreenContainer","MaybeScreen","visible","children","Screen","activityState"],"sourceRoot":"../../../src","sources":["views/ScreenFallback.tsx"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAEEC,IAAI,QAGC,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUtB,IAAIC,OAA0D;AAE9D,IAAI;EACFA,OAAO,GAAGC,OAAO,CAAC,sBAAsB,CAAC;AAC3C,CAAC,CAAC,OAAOC,CAAC,EAAE;EACV;AAAA;AAGF,OAAO,MAAMC,oBAAoB,GAAGA,CAAC;EACnCC,OAAO;EACP,GAAGC;AAKL,CAAC,KAAK;EACJ,IAAIL,OAAO,EAAEM,cAAc,GAAG,CAAC,EAAE;IAC/B,oBAAOP,IAAA,CAACC,OAAO,CAACO,eAAe;MAACH,OAAO,EAAEA,OAAQ;MAAA,GAAKC;IAAI,CAAG,CAAC;EAChE;EAEA,oBAAON,IAAA,CAACF,IAAI;IAAA,GAAKQ;EAAI,CAAG,CAAC;AAC3B,CAAC;AAED,OAAO,SAASG,WAAWA,CAAC;EAAEC,OAAO;EAAEC,QAAQ;EAAE,GAAGL;AAAY,CAAC,EAAE;EACjE,IAAIL,OAAO,EAAEM,cAAc,GAAG,CAAC,EAAE;IAC/B,oBACEP,IAAA,CAACC,OAAO,CAACW,MAAM;MAACC,aAAa,EAAEH,OAAO,GAAG,CAAC,GAAG,CAAE;MAAA,GAAKJ,IAAI;MAAAK,QAAA,EACrDA;IAAQ,CACK,CAAC;EAErB;EAEA,oBACEX,IAAA,CAACJ,kBAAkB;IAACc,OAAO,EAAEA,OAAQ;IAAA,GAAKJ,IAAI;IAAAK,QAAA,EAC3CA;EAAQ,CACS,CAAC;AAEzB","ignoreList":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type DefaultNavigatorOptions, type DrawerNavigationState, type DrawerRouterOptions, type NavigatorTypeBagBase, type ParamListBase, type StaticConfig, type TypedNavigator } from '@react-navigation/native';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import type { DrawerNavigationConfig, DrawerNavigationEventMap, DrawerNavigationOptions, DrawerNavigationProp } from '../types';
|
|
4
3
|
type Props = DefaultNavigatorOptions<ParamListBase, string | undefined, DrawerNavigationState<ParamListBase>, DrawerNavigationOptions, DrawerNavigationEventMap, DrawerNavigationProp<ParamListBase>> & DrawerRouterOptions & DrawerNavigationConfig;
|
|
5
|
-
declare function DrawerNavigator({ id, initialRouteName, defaultStatus, backBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_getStateForRouteNamesChange, ...rest }: Props):
|
|
4
|
+
declare function DrawerNavigator({ id, initialRouteName, defaultStatus, backBehavior, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_getStateForRouteNamesChange, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export declare function createDrawerNavigator<ParamList extends ParamListBase, NavigatorID extends string | undefined = undefined, TypeBag extends NavigatorTypeBagBase = {
|
|
7
6
|
ParamList: ParamList;
|
|
8
7
|
NavigatorID: NavigatorID;
|
|
@@ -13,6 +12,6 @@ export declare function createDrawerNavigator<ParamList extends ParamListBase, N
|
|
|
13
12
|
[RouteName in keyof ParamList]: DrawerNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
14
13
|
};
|
|
15
14
|
Navigator: typeof DrawerNavigator;
|
|
16
|
-
}, Config extends StaticConfig<TypeBag>
|
|
15
|
+
}, Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>>(config?: Config): TypedNavigator<TypeBag, Config>;
|
|
17
16
|
export {};
|
|
18
17
|
//# sourceMappingURL=createDrawerNavigator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDrawerNavigator.d.ts","sourceRoot":"","sources":["../../../../src/navigators/createDrawerNavigator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAE5B,KAAK,qBAAqB,EAE1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"createDrawerNavigator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C,GAAG,YAAY,CAAC,OAAO,CAAC,EAC5D,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAElD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { DrawerContentComponentProps } from '../types';
|
|
3
|
-
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps):
|
|
2
|
+
export declare function DrawerContent({ descriptors, state, ...rest }: DrawerContentComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=DrawerContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"DrawerContent.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAI5D,wBAAgB,aAAa,CAAC,EAC5B,WAAW,EACX,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,2CAgB7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAc,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAc,MAAM,cAAc,CAAC;AA4C5E,eAAO,MAAM,uBAAuB;cAtCxB,KAAK,CAAC,SAAS;oCAwC1B,CAAC"}
|
|
@@ -5,7 +5,7 @@ type Props = {
|
|
|
5
5
|
/**
|
|
6
6
|
* The route object which should be specified by the drawer item.
|
|
7
7
|
*/
|
|
8
|
-
route
|
|
8
|
+
route?: Route<string>;
|
|
9
9
|
/**
|
|
10
10
|
* The `href` to use for the anchor tag on web
|
|
11
11
|
*/
|
|
@@ -87,6 +87,6 @@ type Props = {
|
|
|
87
87
|
/**
|
|
88
88
|
* A component used to show an action item with an icon and a label in a navigation drawer.
|
|
89
89
|
*/
|
|
90
|
-
export declare function DrawerItem(props: Props):
|
|
90
|
+
export declare function DrawerItem(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
91
91
|
export {};
|
|
92
92
|
//# sourceMappingURL=DrawerItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DrawerItem.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,0BAA0B,CAAC;AAEhE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,KAAK,KAAK,GAAG;IACX;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,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|
|
2
1
|
type Props = {
|
|
3
2
|
accessibilityLabel?: string;
|
|
4
3
|
pressColor?: string;
|
|
5
4
|
pressOpacity?: number;
|
|
6
5
|
tintColor?: string;
|
|
7
6
|
};
|
|
8
|
-
export declare function DrawerToggleButton({ tintColor, ...rest }: Props):
|
|
7
|
+
export declare function DrawerToggleButton({ tintColor, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=DrawerToggleButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerToggleButton.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerToggleButton.tsx"],"names":[],"mappings":"
|
|
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,2CAsB/D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type DrawerNavigationState, type DrawerStatus, type ParamListBase } from '@react-navigation/native';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import type { DrawerDescriptorMap, DrawerNavigationConfig, DrawerNavigationHelpers } from '../types';
|
|
4
3
|
type Props = DrawerNavigationConfig & {
|
|
5
4
|
defaultStatus: DrawerStatus;
|
|
@@ -7,6 +6,6 @@ type Props = DrawerNavigationConfig & {
|
|
|
7
6
|
navigation: DrawerNavigationHelpers;
|
|
8
7
|
descriptors: DrawerDescriptorMap;
|
|
9
8
|
};
|
|
10
|
-
export declare function DrawerView({ navigation, ...rest }: Props):
|
|
9
|
+
export declare function DrawerView({ navigation, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
|
12
11
|
//# sourceMappingURL=DrawerView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"DrawerView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerView.tsx"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,aAAa,EAInB,MAAM,0BAA0B,CAAC;AAOlC,OAAO,KAAK,EAEV,mBAAmB,EAEnB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,UAAU,CAAC;AASlB,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;AAoTF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAMxD"}
|
|
@@ -11,7 +11,7 @@ export declare const MaybeScreenContainer: ({ enabled, ...rest }: ViewProps & {
|
|
|
11
11
|
enabled: boolean;
|
|
12
12
|
hasTwoStates: boolean;
|
|
13
13
|
children: React.ReactNode;
|
|
14
|
-
}) =>
|
|
15
|
-
export declare function MaybeScreen({ visible, children, ...rest }: Props):
|
|
14
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function MaybeScreen({ visible, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export {};
|
|
17
17
|
//# sourceMappingURL=ScreenFallback.d.ts.map
|
|
@@ -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,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,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,yBAG9B,SAAS,GAAG;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,
|
|
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,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,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,yBAG9B,SAAS,GAAG;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,4CAMA,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAchE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/drawer",
|
|
3
3
|
"description": "Integration for the drawer component from react-native-drawer-layout",
|
|
4
|
-
"version": "7.0.0-rc.
|
|
4
|
+
"version": "7.0.0-rc.21",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -22,11 +22,17 @@
|
|
|
22
22
|
"url": "https://github.com/react-navigation/react-navigation/issues"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://reactnavigation.org/docs/drawer-navigator/",
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
25
|
+
"source": "./src/index.tsx",
|
|
26
|
+
"main": "./lib/commonjs/index.js",
|
|
27
|
+
"module": "./lib/module/index.js",
|
|
28
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
32
|
+
"import": "./lib/module/index.js",
|
|
33
|
+
"require": "./lib/commonjs/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
30
36
|
"files": [
|
|
31
37
|
"src",
|
|
32
38
|
"lib",
|
|
@@ -41,19 +47,19 @@
|
|
|
41
47
|
"clean": "del lib"
|
|
42
48
|
},
|
|
43
49
|
"dependencies": {
|
|
44
|
-
"@react-navigation/elements": "^2.0.0-rc.
|
|
50
|
+
"@react-navigation/elements": "^2.0.0-rc.16",
|
|
45
51
|
"color": "^4.2.3",
|
|
46
|
-
"react-native-drawer-layout": "^4.0.0-rc.
|
|
47
|
-
"use-latest-callback": "^0.1
|
|
52
|
+
"react-native-drawer-layout": "^4.0.0-rc.8",
|
|
53
|
+
"use-latest-callback": "^0.2.1"
|
|
48
54
|
},
|
|
49
55
|
"devDependencies": {
|
|
50
|
-
"@react-navigation/native": "^7.0.0-rc.
|
|
56
|
+
"@react-navigation/native": "^7.0.0-rc.14",
|
|
51
57
|
"@testing-library/react-native": "^12.4.3",
|
|
52
58
|
"@types/react": "~18.2.79",
|
|
53
59
|
"del-cli": "^5.1.0",
|
|
54
60
|
"react": "18.2.0",
|
|
55
61
|
"react-native": "0.74.2",
|
|
56
|
-
"react-native-builder-bob": "^0.
|
|
62
|
+
"react-native-builder-bob": "^0.26.0",
|
|
57
63
|
"react-native-gesture-handler": "~2.16.1",
|
|
58
64
|
"react-native-reanimated": "~3.10.1",
|
|
59
65
|
"react-native-safe-area-context": "4.10.1",
|
|
@@ -61,20 +67,30 @@
|
|
|
61
67
|
"typescript": "^5.5.2"
|
|
62
68
|
},
|
|
63
69
|
"peerDependencies": {
|
|
64
|
-
"@react-navigation/native": "^7.0.0-rc.
|
|
70
|
+
"@react-navigation/native": "^7.0.0-rc.14",
|
|
65
71
|
"react": ">= 18.2.0",
|
|
66
72
|
"react-native": ">= 0.72.0",
|
|
67
73
|
"react-native-gesture-handler": ">= 2.0.0",
|
|
68
74
|
"react-native-reanimated": ">= 2.0.0",
|
|
69
75
|
"react-native-safe-area-context": ">= 4.0.0",
|
|
70
|
-
"react-native-screens": ">= 3.
|
|
76
|
+
"react-native-screens": ">= 3.21.0"
|
|
71
77
|
},
|
|
72
78
|
"react-native-builder-bob": {
|
|
73
79
|
"source": "src",
|
|
74
80
|
"output": "lib",
|
|
75
81
|
"targets": [
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
[
|
|
83
|
+
"commonjs",
|
|
84
|
+
{
|
|
85
|
+
"esm": true
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
"module",
|
|
90
|
+
{
|
|
91
|
+
"esm": true
|
|
92
|
+
}
|
|
93
|
+
],
|
|
78
94
|
[
|
|
79
95
|
"typescript",
|
|
80
96
|
{
|
|
@@ -83,5 +99,5 @@
|
|
|
83
99
|
]
|
|
84
100
|
]
|
|
85
101
|
},
|
|
86
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "464d69b38e9042ee8db8e245a9c04f75743c5893"
|
|
87
103
|
}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
type TypedNavigator,
|
|
12
12
|
useNavigationBuilder,
|
|
13
13
|
} from '@react-navigation/native';
|
|
14
|
-
import * as React from 'react';
|
|
15
14
|
|
|
16
15
|
import type {
|
|
17
16
|
DrawerNavigationConfig,
|
|
@@ -96,9 +95,7 @@ export function createDrawerNavigator<
|
|
|
96
95
|
};
|
|
97
96
|
Navigator: typeof DrawerNavigator;
|
|
98
97
|
},
|
|
99
|
-
Config extends StaticConfig<TypeBag>
|
|
100
|
-
| StaticConfig<TypeBag>
|
|
101
|
-
| undefined,
|
|
98
|
+
Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>,
|
|
102
99
|
>(config?: Config): TypedNavigator<TypeBag, Config> {
|
|
103
100
|
return createNavigatorFactory(DrawerNavigator)(config);
|
|
104
101
|
}
|
|
@@ -9,6 +9,8 @@ type Props = ScrollViewProps & {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
const SPACING = 12;
|
|
13
|
+
|
|
12
14
|
function DrawerContentScrollViewInner(
|
|
13
15
|
{ contentContainerStyle, style, children, ...rest }: Props,
|
|
14
16
|
ref?: React.Ref<ScrollView>
|
|
@@ -28,10 +30,10 @@ function DrawerContentScrollViewInner(
|
|
|
28
30
|
ref={ref}
|
|
29
31
|
contentContainerStyle={[
|
|
30
32
|
{
|
|
31
|
-
paddingTop: insets.top
|
|
32
|
-
paddingBottom: insets.bottom
|
|
33
|
-
paddingStart: !isRight ? insets.left : 0,
|
|
34
|
-
paddingEnd: isRight ? insets.right : 0,
|
|
33
|
+
paddingTop: SPACING + insets.top,
|
|
34
|
+
paddingBottom: SPACING + insets.bottom,
|
|
35
|
+
paddingStart: SPACING + (!isRight ? insets.left : 0),
|
|
36
|
+
paddingEnd: SPACING + (isRight ? insets.right : 0),
|
|
35
37
|
},
|
|
36
38
|
contentContainerStyle,
|
|
37
39
|
]}
|
package/src/views/DrawerItem.tsx
CHANGED
|
@@ -14,7 +14,7 @@ type Props = {
|
|
|
14
14
|
/**
|
|
15
15
|
* The route object which should be specified by the drawer item.
|
|
16
16
|
*/
|
|
17
|
-
route
|
|
17
|
+
route?: Route<string>;
|
|
18
18
|
/**
|
|
19
19
|
* The `href` to use for the anchor tag on web
|
|
20
20
|
*/
|
|
@@ -114,7 +114,7 @@ export function DrawerItem(props: Props) {
|
|
|
114
114
|
style,
|
|
115
115
|
onPress,
|
|
116
116
|
pressColor,
|
|
117
|
-
pressOpacity,
|
|
117
|
+
pressOpacity = 1,
|
|
118
118
|
testID,
|
|
119
119
|
accessibilityLabel,
|
|
120
120
|
...rest
|
|
@@ -142,11 +142,12 @@ export function DrawerItem(props: Props) {
|
|
|
142
142
|
accessibilityState={{ selected: focused }}
|
|
143
143
|
pressColor={pressColor}
|
|
144
144
|
pressOpacity={pressOpacity}
|
|
145
|
+
hoverEffect={{ color }}
|
|
145
146
|
href={href}
|
|
146
147
|
>
|
|
147
148
|
<View style={[styles.wrapper, { borderRadius }]}>
|
|
148
149
|
{iconNode}
|
|
149
|
-
<View style={[styles.label, { marginStart: iconNode ?
|
|
150
|
+
<View style={[styles.label, { marginStart: iconNode ? 12 : 0 }]}>
|
|
150
151
|
{typeof label === 'string' ? (
|
|
151
152
|
<Text
|
|
152
153
|
numberOfLines={1}
|
|
@@ -167,14 +168,12 @@ export function DrawerItem(props: Props) {
|
|
|
167
168
|
|
|
168
169
|
const styles = StyleSheet.create({
|
|
169
170
|
container: {
|
|
170
|
-
marginHorizontal: 12,
|
|
171
|
-
marginVertical: 2,
|
|
172
171
|
overflow: 'hidden',
|
|
173
172
|
},
|
|
174
173
|
wrapper: {
|
|
175
174
|
flexDirection: 'row',
|
|
176
175
|
alignItems: 'center',
|
|
177
|
-
paddingVertical:
|
|
176
|
+
paddingVertical: 11,
|
|
178
177
|
paddingStart: 16,
|
|
179
178
|
paddingEnd: 24,
|
|
180
179
|
},
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
type ParamListBase,
|
|
5
5
|
useNavigation,
|
|
6
6
|
} from '@react-navigation/native';
|
|
7
|
-
import * as React from 'react';
|
|
8
7
|
import { Image, Platform, StyleSheet } from 'react-native';
|
|
9
8
|
|
|
10
9
|
import type { DrawerNavigationProp } from '../types';
|
|
10
|
+
import toggleDrawerIcon from './assets/toggle-drawer-icon.png';
|
|
11
11
|
|
|
12
12
|
type Props = {
|
|
13
13
|
accessibilityLabel?: string;
|
|
@@ -33,7 +33,7 @@ export function DrawerToggleButton({ tintColor, ...rest }: Props) {
|
|
|
33
33
|
<Image
|
|
34
34
|
style={[styles.icon, tintColor ? { tintColor } : null]}
|
|
35
35
|
resizeMode="contain"
|
|
36
|
-
source={
|
|
36
|
+
source={toggleDrawerIcon}
|
|
37
37
|
fadeDuration={0}
|
|
38
38
|
/>
|
|
39
39
|
</PlatformPressable>
|