Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Commit

Permalink
refactor: rewrite drawer layout with reanimated (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Aug 18, 2019
1 parent e47dcdb commit 4bdd06a
Show file tree
Hide file tree
Showing 5 changed files with 678 additions and 157 deletions.
10 changes: 5 additions & 5 deletions packages/drawer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as DrawerAcions from './routers/DrawerActions';

/**
* Navigators
*/
/**
* Router
*/
import * as DrawerAcions from './routers/DrawerActions';

export {
default as createDrawerNavigator,
} from './navigators/createDrawerNavigator';

/**
* Router
*/
export { DrawerAcions };
export { default as DrawerRouter } from './routers/DrawerRouter';

Expand Down
6 changes: 2 additions & 4 deletions packages/drawer/src/navigators/createDrawerNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { Dimensions, Platform, ScrollView } from 'react-native';
import { Dimensions, Platform, ScrollView, I18nManager } from 'react-native';
import { createNavigator } from '@react-navigation/core';
import { SafeAreaView } from '@react-navigation/native';
import DrawerRouter from '../routers/DrawerRouter';
Expand Down Expand Up @@ -35,14 +35,12 @@ const DefaultDrawerConfig = {
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
},
contentComponent: defaultContentComponent,
drawerPosition: 'left',
drawerPosition: I18nManager.isRTL ? 'right' : 'left',
keyboardDismissMode: 'on-drag',
drawerBackgroundColor: 'white',
useNativeAnimations: true,
drawerType: 'front',
hideStatusBar: false,
statusBarAnimation: 'slide',
overlayColor: 'black',
};

const DrawerNavigator = (routeConfigs: object, config: any = {}) => {
Expand Down
4 changes: 0 additions & 4 deletions packages/drawer/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ export type Navigation = {
key: string;
index: number;
routes: Route[];
openId: string;
closeId: string;
toggleId: string;
isDrawerIdle: boolean;
isDrawerOpen: boolean;
};
openDrawer: () => void;
Expand Down
Loading

0 comments on commit 4bdd06a

Please sign in to comment.