diff --git a/README.md b/README.md index bc06e87..9fc9d80 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ The **``** object used to initialize the navigation can take the follo - `firstRoute` (required): A React class corresponding to the first page of your navigation - `headerStyle`: Apply a StyleSheet to the navigation bar. You'll probably want to change the backgroundColor for example. - `titleStyle`: Apply a StyleSheet to the navigation bar titles. Useful for changing the font or text color. +- `backButtonStyle`: Apply a StyleSheet to the back button. Useful for changing the color. - `backButtonComponent`: By default, the navigation bar will display a simple "Back" text for the back button. To change this, you can specify your own backButton component (like in the Twitter app). - `rightCorner`: If you have the same occuring action buttons on the right side of your navigation bar (like the Twitter "Compose"-button), you can specify a component for that view. - `customAction`: A special callback prop for your action buttons (this can be handy for triggering a side menu for example). The action gets triggered from your custom `leftCorner` or `rightCorner` components by calling `this.props.customAction("someActionName")` from them. It is then picked up like this: ``. @@ -124,4 +125,3 @@ Questions? --------- If something is unclear or if you just want to say hi, feel free to [follow me on Twitter](https://twitter.com/t4t5)! - diff --git a/components/NavBarContainer.js b/components/NavBarContainer.js index 7fda8ff..cbe6d30 100644 --- a/components/NavBarContainer.js +++ b/components/NavBarContainer.js @@ -43,16 +43,18 @@ var NavBarContainer = React.createClass({ render: function() { return ( - - ; } else if (this.props.route.index > 0) { - leftCornerContent = ; + leftCornerContent = ; } leftCorner = ( diff --git a/components/NavButton.js b/components/NavButton.js index 2ec6f26..f086489 100644 --- a/components/NavButton.js +++ b/components/NavButton.js @@ -23,7 +23,8 @@ var NavButton = React.createClass({ var BackButton = this.props.backButtonComponent; backButton = } else { - backButton = Back + var hasBackButtonStyle = this.props.backButtonStyle; + backButton = Back } return ( diff --git a/index.js b/index.js index d8becf7..cd5f995 100644 --- a/index.js +++ b/index.js @@ -62,8 +62,8 @@ var Router = React.createClass({ var didStartDrag = function(evt) { var x = evt.nativeEvent.pageX; if (x < 28) { - this.setState({ - dragStartX: x, + this.setState({ + dragStartX: x, didSwitchView: false }); return true; @@ -85,7 +85,7 @@ var Router = React.createClass({ }; var Content = route.component; - + return ( ) - + }, render: function() { @@ -115,9 +115,10 @@ var Router = React.createClass({ navigationBar={