@@ -71,7 +71,6 @@ declare interface RNNDrawerOptions {
71
71
drawerScreenHeight ?: number ;
72
72
}
73
73
74
-
75
74
enum DirectionType {
76
75
left = 'left' ,
77
76
right = 'right' ,
@@ -131,11 +130,11 @@ interface SwipeMoveInterface {
131
130
132
131
class RNNDrawer {
133
132
/**
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
+ */
139
138
static create ( Component : React . ComponentType ) : any {
140
139
class WrappedDrawer extends React . Component < IProps , IState > {
141
140
private readonly screenWidth : number ;
@@ -255,10 +254,7 @@ class RNNDrawer {
255
254
/** Component Variables */
256
255
this . drawerWidth = this . isLandscape ( )
257
256
? MaxWidthOnLandscapeMode
258
- : _resolveDrawerSize (
259
- props . drawerScreenWidth ,
260
- this . screenWidth ,
261
- ) ;
257
+ : _resolveDrawerSize ( props . drawerScreenWidth , this . screenWidth ) ;
262
258
this . drawerHeight = _resolveDrawerSize (
263
259
props . drawerScreenHeight ,
264
260
this . screenHeight ,
@@ -368,19 +364,19 @@ class RNNDrawer {
368
364
const { direction, fadeOpacity } = this . props ;
369
365
370
366
// Adapt the drawer's size on orientation change
371
- Dimensions . addEventListener ( " change" , ( { window } ) => {
367
+ Dimensions . addEventListener ( ' change' , ( { window } ) => {
372
368
const screenHeight = window . height ;
373
369
374
370
this . setState ( { screenHeight } ) ;
375
371
376
372
// Apply correct position if opened from right
377
- if ( this . props . direction === " right" ) {
373
+ if ( this . props . direction === ' right' ) {
378
374
// Calculates the position of the drawer from the left side of the screen
379
375
const alignedMovementValue = window . width - this . drawerWidth ;
380
376
381
377
this . state . sideMenuOpenValue . setValue ( alignedMovementValue ) ;
382
378
}
383
- } )
379
+ } ) ;
384
380
385
381
// Executes when the side of the screen interaction starts
386
382
this . unsubscribeSwipeStart = listen ( 'SWIPE_START' , ( ) => {
@@ -476,7 +472,7 @@ class RNNDrawer {
476
472
* Removes all the listenrs from this component
477
473
*/
478
474
removeListeners ( ) {
479
- Dimensions . removeEventListener ( " change" , ( ) => { } ) ;
475
+ Dimensions . removeEventListener ( ' change' , ( ) => { } ) ;
480
476
if ( this . unsubscribeSwipeStart ) this . unsubscribeSwipeStart ( ) ;
481
477
if ( this . unsubscribeSwipeMove ) this . unsubscribeSwipeMove ( ) ;
482
478
if ( this . unsubscribeSwipeEnd ) this . unsubscribeSwipeEnd ( ) ;
0 commit comments