From 33a92c8cd6951874a8c5a434b185f51b62b003f5 Mon Sep 17 00:00:00 2001 From: cristiadam Date: Mon, 3 Apr 2017 14:27:57 +0300 Subject: [PATCH 1/2] added support for app-wide hide header --- src/core/App.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/App.js b/src/core/App.js index 409de92..df7b35d 100644 --- a/src/core/App.js +++ b/src/core/App.js @@ -7,7 +7,6 @@ export default class App extends Component { constructor(props) { super(props) - this.init() } @@ -91,7 +90,14 @@ export default class App extends Component { } } - this._navigator = StackNavigator(navigators) + this._navigator = StackNavigator(navigators,{ + headerMode: this.props.hideHeader ? 'screen' : 'float', + navigationOptions: { + header: { + visible: !this.props.hideHeader + } + } + }) } get navigator() { From dcc7e3f8df95888bc1185ddb3ef975e86c673c42 Mon Sep 17 00:00:00 2001 From: cristiadam Date: Thu, 6 Apr 2017 14:43:08 +0300 Subject: [PATCH 2/2] global hideHeader should override the screen hideHeader prop --- src/core/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/App.js b/src/core/App.js index df7b35d..ca613fa 100644 --- a/src/core/App.js +++ b/src/core/App.js @@ -44,7 +44,7 @@ export default class App extends Component { const navigationOptions = { title: route.title, header: { - visible: !route.hideHeader, + visible: !(route.hideHeader || this.props.hideHeader), tintColor: Styles.styleColor(this.props.theme.tintColor || "#FFFFFF"), style: { backgroundColor: Styles.styleColor(this.props.theme.navigationColor) }, }