Skip to content

Commit

Permalink
drawer fixed and faulty closeDrawer removed (#2745)
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhavagarwal5 authored and aksonov committed Dec 29, 2017
1 parent af8d461 commit 2843534
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => (
<Router
createReducer={reducerCreate}
getSceneStyle={getSceneStyle}
uriPrefix={prefix}
>
backAndroidHandler={onBackPress}>

<Overlay key="overlay">
<Modal key="modal"
hideNavBar
Expand Down Expand Up @@ -130,6 +139,9 @@ const Example = () => (
contentComponent={DrawerContent}
drawerImage={MenuIcon}
drawerWidth={300}
drawerOpenRoute = 'DrawerOpen'
drawerCloseRoute = 'DrawerClose'
drawerToggleRoute = 'DrawerToggle'
>
{/*
Wrapper Scene needed to fix a bug where the tabs would
Expand Down
4 changes: 2 additions & 2 deletions Example/components/drawer/DrawerContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class DrawerContent extends React.Component {
render() {
return (
<View style={styles.container}>
<Text>Drawer Content</Text>
<Button onPress={Actions.closeDrawer}>Back</Button>
{/* <Text>Drawer Content</Text>
<Button onPress={Actions.closeDrawer}>Back</Button> */}
<Text>Title: {this.props.title}</Text>
{this.props.name === 'tab1_1' &&
<Button onPress={Actions.tab_1_2}>next screen for tab1_1</Button>
Expand Down

0 comments on commit 2843534

Please sign in to comment.