Skip to content

Commit a30b4bf

Browse files
fixing conflicts
2 parents 0af5307 + 839c8f5 commit a30b4bf

File tree

4 files changed

+68
-14
lines changed

4 files changed

+68
-14
lines changed

.DS_Store

-6 KB
Binary file not shown.

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# React Native Navigation Drawer Extension
1+
<h2 align="center">
2+
<img src="https://user-images.githubusercontent.com/7014073/98849326-cca07f80-2431-11eb-82dd-fd2b4e52be44.png?s=300" width="500" /><br/>
3+
React Native Navigation Drawer Extension
4+
</h2>
25

3-
[React Native Navigation by Wix](https://wix.github.io/react-native-navigation/#/) does not offer an in-built solution for displaying a drawer on iOS. Their current side-menu has limited functionality on both iOS and Android. This is a drawer solution using showOverlay under the hood to display a drawer on iOS and Android.
4-
5-
If you are using React Native Navigation >= 3.0.0 then use version 3.x.x + of this library.
6-
7-
<p align="left">
6+
<p align="center">
87
<a href="https://www.npmjs.com/package/react-native-navigation-drawer-extension" rel="nofollow">
98
<img src="https://img.shields.io/npm/v/react-native-navigation-drawer-extension.svg?style=flat-square" alt="version" style="max-width:100%;" />
109
</a>
@@ -14,9 +13,12 @@ If you are using React Native Navigation >= 3.0.0 then use version 3.x.x + of th
1413
<a href="https://www.npmjs.com/package/react-native-navigation-drawer-extension" rel="nofollow">
1514
<img src="http://img.shields.io/npm/dt/react-native-navigation-drawer-extension.svg?style=flat-square" alt="downloads" style="max-width:100%;" />
1615
</a>
17-
<hr />
1816
</p>
1917

18+
[React Native Navigation by Wix](https://wix.github.io/react-native-navigation/#/) does not offer an in-built solution for displaying a drawer on iOS. Their current side-menu has limited functionality on both iOS and Android. This is a drawer solution using showOverlay under the hood to display a drawer on iOS and Android.
19+
20+
If you are using React Native Navigation >= 3.0.0 then use version 3.x.x + of this library.
21+
2022
<img align="left" src="https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/left-drawer.gif" width="48%" />
2123
<img src="https://raw.githubusercontent.com/LukeBrandonFarrell/open-source-images/master/react-native-navigation-drawer-extension/bottom-drawer.gif" width="48%" />
2224

@@ -64,13 +66,11 @@ RNNDrawer.showDrawer({
6466
style: { // Styles the drawer container, supports any react-native style
6567
backgroundColor: "red",
6668
},
67-
parentComponentId: this.props.componentId, // Custom prop, will be available in your custom drawer component props
69+
parentComponentId: props.componentId, // Custom prop, will be available in your custom drawer component props
6870
},
6971
}
7072
});
71-
```
7273

73-
```js
7474
RNNDrawer.dismissDrawer();
7575
````
7676

lib/RNNDrawer.d.ts

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,68 @@
44
*/
55
import * as React from 'react';
66
import { Layout } from 'react-native-navigation';
7+
8+
type DirectionType = "left" | "right" | "top" | "bottom";
9+
10+
declare interface RNNDrawerOptions {
11+
/**
12+
* Id of parent component of the drawer.
13+
* This field is necessary in order to be able
14+
* to push screens inside the drawer
15+
*/
16+
parentComponentId: string;
17+
18+
/**
19+
* Time in milliseconds to execute the drawer opening animation
20+
*/
21+
animationOpenTime?: number;
22+
23+
/**
24+
* Time in milliseconds to execute the drawer closing animation
25+
*/
26+
animationCloseTime?: number;
27+
28+
/**
29+
* Direction to open the collage,
30+
* one of: ["left", "right", "top", "bottom"]
31+
*/
32+
direction?: DirectionType;
33+
34+
/**
35+
* Whether the drawer be dismissed when a click is registered outside
36+
*/
37+
dismissWhenTouchOutside?: boolean;
38+
39+
/**
40+
* Opacity of the screen outside the drawer
41+
*/
42+
fadeOpacity?: number;
43+
44+
/**
45+
* Width of drawer in relation to the screen (0 to 1)
46+
*/
47+
drawerScreenWidth?: number;
48+
49+
/**
50+
* Height of drawer in relation to the screen (0 to 1)
51+
*/
52+
drawerScreenHeight?: number;
53+
}
54+
755
declare class RNNDrawer {
56+
/**
57+
* Generates the drawer component to
58+
* be used with react-native-navigation
59+
*
60+
* @param component
61+
*/
862
static create(Component: React.ComponentType): any;
963
/**
1064
* Shows a drawer component
1165
*
1266
* @param layout
1367
*/
14-
static showDrawer(layout: Layout): void;
68+
static showDrawer(layout: Layout<RNNDrawerOptions>): void;
1569
/**
1670
* Dismiss the drawer component
1771
*/

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)