File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const {
3232 Header : NavigationHeader ,
3333 } = NavigationExperimental ;
3434
35- export default class extends React . Component {
35+ export default class NavBar extends React . Component {
3636 componentWillMount ( ) {
3737 const state = this . props . navigationState ;
3838 this . _renderRightButton = this . _renderRightButton . bind ( this ) ;
@@ -78,7 +78,18 @@ export default class extends React.Component {
7878
7979 _renderBackButton ( ) {
8080 if ( this . props . navigationState . index === 0 ) {
81+ if ( ! ! this . context . drawer && typeof this . context . drawer . toggle === 'function' ) {
82+ return (
83+ < TouchableOpacity style = { [ styles . backButton , this . props . navigationState . leftButtonStyle ] } onPress = { ( ) => {
84+ var drawer = this . context . drawer ;
85+ drawer . toggle ( ) ;
86+ } } >
87+ < Image source = { require ( './menu_burger.png' ) } style = { [ styles . backButtonImage , this . props . navigationState . barButtonIconStyle ] } />
88+ </ TouchableOpacity >
89+ ) ;
90+ } else {
8191 return null ;
92+ }
8293 }
8394 return (
8495 < TouchableOpacity style = { [ styles . backButton , this . props . navigationState . leftButtonStyle ] } onPress = { Actions . pop } >
@@ -153,6 +164,11 @@ export default class extends React.Component {
153164
154165}
155166
167+
168+ NavBar . contextTypes = {
169+ drawer : React . PropTypes . object
170+ }
171+
156172const styles = StyleSheet . create ( {
157173 title : {
158174 textAlign : 'center' ,
You can’t perform that action at this time.
0 commit comments