From 2843534a3b031436200f1380eb037bb3bf30e5c5 Mon Sep 17 00:00:00 2001 From: Vibhav Agarwal Date: Fri, 29 Dec 2017 14:49:49 +0530 Subject: [PATCH] drawer fixed and faulty closeDrawer removed (#2745) --- Example/Example.js | 14 +++++++++++++- Example/components/drawer/DrawerContent.js | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Example/Example.js b/Example/Example.js index 4409d1aa9..0f005d6f3 100644 --- a/Example/Example.js +++ b/Example/Example.js @@ -62,12 +62,21 @@ const getSceneStyle = () => ({ // on Android, the URI prefix typically contains a host in addition to scheme const prefix = Platform.OS === 'android' ? 'mychat://mychat/' : 'mychat://'; +const onBackPress = () => { + if (Actions.state.index !== 0) { + return false + } + Actions.pop() + return true + } + const Example = () => ( + backAndroidHandler={onBackPress}> + ( contentComponent={DrawerContent} drawerImage={MenuIcon} drawerWidth={300} + drawerOpenRoute = 'DrawerOpen' + drawerCloseRoute = 'DrawerClose' + drawerToggleRoute = 'DrawerToggle' > {/* Wrapper Scene needed to fix a bug where the tabs would diff --git a/Example/components/drawer/DrawerContent.js b/Example/components/drawer/DrawerContent.js index ce376fd79..837055567 100644 --- a/Example/components/drawer/DrawerContent.js +++ b/Example/components/drawer/DrawerContent.js @@ -29,8 +29,8 @@ class DrawerContent extends React.Component { render() { return ( - Drawer Content - + {/* Drawer Content + */} Title: {this.props.title} {this.props.name === 'tab1_1' &&