-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
22 changed files
with
318 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import Header from './Header'; | ||
import SubHeader from './SubHeader'; | ||
import TitleHeader from './TitleHeader'; | ||
import styles from './styles'; | ||
|
||
export { Header, SubHeader, TitleHeader, styles }; | ||
export { Header, SubHeader, TitleHeader }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import { LOADED, LOADING } from './constants'; | ||
import { StackNavigator, addNavigationHelpers, NavigationActions } from 'react-navigation'; | ||
import { Navigator } from '../navigators/AppNavigator'; | ||
import { createReducer } from './reducerHelper'; | ||
|
||
const initialState = { | ||
loading: false | ||
const getCurrentRouteName = state => { | ||
const route = state.routes[state.index]; | ||
return typeof route.index === 'undefined' ? route.routeName : getCurrentRouteName(route); | ||
}; | ||
|
||
const loadReducer = { | ||
[LOADING]: (state, { loading }) => ({ ...state, loading }) | ||
export const reducers = (state, action) => { | ||
// Simply return the original `state` if `nextState` is null or undefined. | ||
const nextState = Navigator.router.getStateForAction(action, state); | ||
// console.log(state, action); | ||
// prevents navigating twice to the same route | ||
if (state && nextState) { | ||
const stateRouteName = getCurrentRouteName(state); | ||
const nextStateRouteName = getCurrentRouteName(nextState); | ||
return stateRouteName === nextStateRouteName ? state : nextState; | ||
} | ||
return nextState || state; | ||
}; | ||
|
||
export const reducers = createReducer(initialState, { | ||
...loadReducer | ||
}); | ||
|
||
export const getLoading = state => state.load.loading; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.