From 14c454fafd47b2288f3c04e968b20ab92f896571 Mon Sep 17 00:00:00 2001 From: Alexandru Lazar Date: Thu, 9 Jun 2016 11:20:46 +0300 Subject: [PATCH 1/2] [navBar]: add a more custom menu item to be able to have text or font icon if necesarry, or whatever custom view you want to add there --- src/NavBar.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/NavBar.js b/src/NavBar.js index acf6808e0..eae7e63e9 100644 --- a/src/NavBar.js +++ b/src/NavBar.js @@ -281,6 +281,7 @@ class NavBar extends React.Component { function tryRender(state, wrapBy) { let onPress = state.onLeft; let buttonImage = state.leftButtonImage; + let menuIcon = state.drawerIcon; const style = [styles.leftButton, self.props.leftButtonStyle, state.leftButtonStyle]; const textStyle = [styles.barLeftButtonText, self.props.leftButtonTextStyle, state.leftButtonTextStyle]; @@ -304,9 +305,13 @@ class NavBar extends React.Component { if (!onPress && !!drawer && typeof drawer.toggle === 'function') { buttonImage = state.drawerImage; - if (buttonImage) { + if (buttonImage || menuIcon) { onPress = drawer.toggle; } + if (!menuIcon) { + menuIcon = (); + } } if (onPress && (state.leftTitle || buttonImage)) { @@ -325,10 +330,7 @@ class NavBar extends React.Component { } {buttonImage && - + {menuIcon} } From c5fac59d8b71834d46279620b8f12ea9e0651ec1 Mon Sep 17 00:00:00 2001 From: Alexandru Lazar Date: Thu, 9 Jun 2016 11:25:03 +0300 Subject: [PATCH 2/2] [navBar]: fix eslint indentation --- src/NavBar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/NavBar.js b/src/NavBar.js index eae7e63e9..ffd396d61 100644 --- a/src/NavBar.js +++ b/src/NavBar.js @@ -309,8 +309,12 @@ class NavBar extends React.Component { onPress = drawer.toggle; } if (!menuIcon) { - menuIcon = (); + menuIcon = ( + + ); } }