From 4fc89fed8f96d951327bc7f1974cc6f05204bd16 Mon Sep 17 00:00:00 2001 From: katrinanova Date: Sun, 3 Jan 2016 19:42:30 -0500 Subject: [PATCH 1/2] Update NavigatorIOS.ios.js Allow props passed to the route object to overwrite props passed to the navigator. --- .../Components/Navigation/NavigatorIOS.ios.js | 44 ++++++++++++++++--- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index 135ad6f12c44c8..571a81bec83964 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -247,16 +247,46 @@ var NavigatorIOS = React.createClass({ * Styles for the navigation item containing the component */ wrapperStyle: View.propTypes.style, + + /** + * A Boolean value that indicates whether the navigation bar is hidden + */ + navigationBarHidden: PropTypes.bool, + + /** + * A Boolean value that indicates whether to hide the 1px hairline shadow + */ + shadowHidden: PropTypes.bool, + + /** + * The color used for buttons in the navigation bar + */ + tintColor: PropTypes.string, + + /** + * The background color of the navigation bar + */ + barTintColor: PropTypes.string, + + /** + * The text color of the navigation bar title + */ + titleTextColor: PropTypes.string, + + /** + * A Boolean value that indicates whether the navigation bar is translucent + */ + translucent: PropTypes.bool, }).isRequired, /** - * A Boolean value that indicates whether the navigation bar is hidden + * A Boolean value that indicates whether the navigation bar is hidden by default */ navigationBarHidden: PropTypes.bool, /** - * A Boolean value that indicates whether to hide the 1px hairline shadow + * A Boolean value that indicates whether to hide the 1px hairline shadow by default */ shadowHidden: PropTypes.bool, @@ -267,22 +297,22 @@ var NavigatorIOS = React.createClass({ itemWrapperStyle: View.propTypes.style, /** - * The color used for buttons in the navigation bar + * The default color used for buttons in the navigation bar */ tintColor: PropTypes.string, /** - * The background color of the navigation bar + * The default background color of the navigation bar */ barTintColor: PropTypes.string, /** - * The text color of the navigation bar title + * The default text color of the navigation bar title */ titleTextColor: PropTypes.string, /** - * A Boolean value that indicates whether the navigation bar is translucent + * A Boolean value that indicates whether the navigation bar is translucent by default */ translucent: PropTypes.bool, @@ -610,8 +640,8 @@ var NavigatorIOS = React.createClass({ return ( Date: Mon, 4 Jan 2016 00:06:38 -0500 Subject: [PATCH 2/2] add description of how to configure navbar --- Libraries/Components/Navigation/NavigatorIOS.ios.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Libraries/Components/Navigation/NavigatorIOS.ios.js b/Libraries/Components/Navigation/NavigatorIOS.ios.js index 571a81bec83964..e21cc6d852714b 100644 --- a/Libraries/Components/Navigation/NavigatorIOS.ios.js +++ b/Libraries/Components/Navigation/NavigatorIOS.ios.js @@ -172,6 +172,11 @@ type Event = Object; * }); * ``` * + * Props passed to the NavigatorIOS component will set the default configuration + * for the navigation bar. Props passed as properties to a route object will set + * the configuration for that route's navigation bar, overriding any props + * passed to the NavigatorIOS component. + * */ var NavigatorIOS = React.createClass({ @@ -247,12 +252,12 @@ var NavigatorIOS = React.createClass({ * Styles for the navigation item containing the component */ wrapperStyle: View.propTypes.style, - + /** * A Boolean value that indicates whether the navigation bar is hidden */ navigationBarHidden: PropTypes.bool, - + /** * A Boolean value that indicates whether to hide the 1px hairline shadow */ @@ -262,12 +267,12 @@ var NavigatorIOS = React.createClass({ * The color used for buttons in the navigation bar */ tintColor: PropTypes.string, - + /** * The background color of the navigation bar */ barTintColor: PropTypes.string, - + /** * The text color of the navigation bar title */