Skip to content

Commit 1d3b49e

Browse files
updating example folder and release docs
1 parent f546d29 commit 1d3b49e

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 3.1.0 (November 2020)
1+
## 3.2.0 (November 2020)
22
- Added orientation support
33
- Drawer can now be closed by swipping it
44
- Added example project

example/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.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"react": "16.13.1",
1515
"react-native": "0.63.3",
1616
"react-native-navigation": "^7.2.0",
17-
"react-native-navigation-drawer-extension": "^3.0.0"
17+
"react-native-navigation-drawer-extension": "^3.2.0"
1818
},
1919
"devDependencies": {
2020
"@babel/core": "^7.8.4",

src/RNNDrawer.tsx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ declare interface RNNDrawerOptions {
7171
drawerScreenHeight?: number;
7272
}
7373

74-
7574
enum DirectionType {
7675
left = 'left',
7776
right = 'right',
@@ -131,11 +130,11 @@ interface SwipeMoveInterface {
131130

132131
class RNNDrawer {
133132
/**
134-
* Generates the drawer component to
135-
* be used with react-native-navigation
136-
*
137-
* @param component
138-
*/
133+
* Generates the drawer component to
134+
* be used with react-native-navigation
135+
*
136+
* @param component
137+
*/
139138
static create(Component: React.ComponentType): any {
140139
class WrappedDrawer extends React.Component<IProps, IState> {
141140
private readonly screenWidth: number;
@@ -255,10 +254,7 @@ class RNNDrawer {
255254
/** Component Variables */
256255
this.drawerWidth = this.isLandscape()
257256
? MaxWidthOnLandscapeMode
258-
: _resolveDrawerSize(
259-
props.drawerScreenWidth,
260-
this.screenWidth,
261-
);
257+
: _resolveDrawerSize(props.drawerScreenWidth, this.screenWidth);
262258
this.drawerHeight = _resolveDrawerSize(
263259
props.drawerScreenHeight,
264260
this.screenHeight,
@@ -368,19 +364,19 @@ class RNNDrawer {
368364
const { direction, fadeOpacity } = this.props;
369365

370366
// Adapt the drawer's size on orientation change
371-
Dimensions.addEventListener("change", ({ window }) => {
367+
Dimensions.addEventListener('change', ({ window }) => {
372368
const screenHeight = window.height;
373369

374370
this.setState({ screenHeight });
375371

376372
// Apply correct position if opened from right
377-
if (this.props.direction === "right") {
373+
if (this.props.direction === 'right') {
378374
// Calculates the position of the drawer from the left side of the screen
379375
const alignedMovementValue = window.width - this.drawerWidth;
380376

381377
this.state.sideMenuOpenValue.setValue(alignedMovementValue);
382378
}
383-
})
379+
});
384380

385381
// Executes when the side of the screen interaction starts
386382
this.unsubscribeSwipeStart = listen('SWIPE_START', () => {
@@ -476,7 +472,7 @@ class RNNDrawer {
476472
* Removes all the listenrs from this component
477473
*/
478474
removeListeners() {
479-
Dimensions.removeEventListener("change", () => { });
475+
Dimensions.removeEventListener('change', () => {});
480476
if (this.unsubscribeSwipeStart) this.unsubscribeSwipeStart();
481477
if (this.unsubscribeSwipeMove) this.unsubscribeSwipeMove();
482478
if (this.unsubscribeSwipeEnd) this.unsubscribeSwipeEnd();

0 commit comments

Comments
 (0)