-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Navigation (see #51) #89
Conversation
8bb15c6
to
64da2b1
Compare
const currentTab = navigationState.getIn(['routes', navigationState.get('index')]); | ||
const tabs = navigationState.get('tabs'); | ||
const tabKey = tabs.getIn(['routes', tabs.get('index')]).get('key'); | ||
const currentTab = navigationState.get(tabKey); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the way to find currentTab
accordingly to the navigationState
changes
- use NavigationExperimental Card Stack - simplify navigationState separating tabs reducer from scene reducer - simplify navigation views - handle Android back button - remove unnecessary import of AppRouter - fixes futurice#85
64da2b1
to
8a1a764
Compare
@@ -50,7 +49,7 @@ const AppView = React.createClass({ | |||
|
|||
return ( | |||
<View style={{flex: 1}}> | |||
<NavigationViewContainer router={AppRouter} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #85
+1 Approve cool, want to use this one. |
@fabriziomoscon just got through a first pass review on this, awesome job! 💯 🍻 This is a lot cleaner and more future-proof that our previous solution! There are a couple of tiny fixes I'll need to make to merge this:
I want to get this merged ASAP, so I'll just cherry pick your changes to a new branch, fix and test these, and push it up. |
thanks. If you prefer I can fix those 2 point and repush |
I just merged this to master 🎉 Thanks @fabriziomoscon, hit me up sometime and I'll buy you a beer! |
Inspired by:
https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/js/NavigationExperimental/NavigationCardStack-NavigationHeader-Tabs-example.js
and other example online
tested on Android on physical device
not tested on ios because of #77