From ed7213a9b8232866929a3bd2871ca512391c3352 Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Tue, 6 Feb 2018 12:25:23 -0500 Subject: [PATCH 1/2] add getShouldDisplay conditional --- src/NavigatorNavigationBar.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/NavigatorNavigationBar.js b/src/NavigatorNavigationBar.js index 61d50e9..70173a3 100644 --- a/src/NavigatorNavigationBar.js +++ b/src/NavigatorNavigationBar.js @@ -164,14 +164,20 @@ class NavigatorNavigationBar extends React.Component { this._getComponent(componentName, route, index) ) ); - - return ( + + let ret = ( {components} - ); + ); + + if (this.getShouldDisplay) { + return this.getShouldDisplay() ? ret : null; + } else { + return ret; + } } _getComponent = (/*string*/componentName, /*object*/route, /*number*/index) => /*?Object*/ { From d2edb125dd273763ad107e5bb0ad6b11d3c7e7a6 Mon Sep 17 00:00:00 2001 From: Jesse Sessler Date: Thu, 11 Oct 2018 13:43:00 -0500 Subject: [PATCH 2/2] If nav bar isn't on the active screen, set zIndex to -1 --- src/NavigatorNavigationBar.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/NavigatorNavigationBar.js b/src/NavigatorNavigationBar.js index 70173a3..c0737a5 100644 --- a/src/NavigatorNavigationBar.js +++ b/src/NavigatorNavigationBar.js @@ -165,19 +165,19 @@ class NavigatorNavigationBar extends React.Component { ) ); - let ret = ( + return ( - {components} + style={[ + styles.navBarContainer, + !this.getShouldDisplay() && styles.navBarHidden, + navBarStyle, + this.props.style + ]} + > + {components} - ); - - if (this.getShouldDisplay) { - return this.getShouldDisplay() ? ret : null; - } else { - return ret; - } + ); } _getComponent = (/*string*/componentName, /*object*/route, /*number*/index) => /*?Object*/ { @@ -226,6 +226,9 @@ var styles = StyleSheet.create({ right: 0, backgroundColor: 'transparent', }, + navBarHidden: { + zIndex: -1, + }, }); module.exports = NavigatorNavigationBar;