Add react-navigation to dependencies

parent 090e884a
......@@ -13,10 +13,10 @@ import reducers from './reducers';
import i18n from './utils/i18n';
import sagas from './sagas';
import ReduxNavigator from './ui/components/navigator/ReduxNavigator';
import * as sessionActions from './actions/session';
import * as deepLinkingActions from './actions/deepLinking';
import { register } from './actions/pushNotifications';
import NavigationService from './navigation';
const sagaMiddleware = createSagaMiddleware();
const store = createStore(reducers, applyMiddleware(sagaMiddleware));
......@@ -77,7 +77,11 @@ class Main extends Component {
return (
<I18nextProvider i18n={i18n}>
<Provider store={store}>
<ReduxNavigator />
<NavigationService.AppNavigator
ref={(navigatorRef) => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
</Provider>
</I18nextProvider>
);
......
import { createStackNavigator, createSwitchNavigator, NavigationActions, } from 'react-navigation';
import Login from './ui/screens/user/Login';
import Welcome from './ui/screens/welcome/Welcome';
import Event from './ui/screens/events/Event';
import Profile from './ui/screens/user/Profile';
import Pizza from './ui/screens/pizza/Pizza';
import Registration from './ui/screens/events/Registration';
import SplashScreen from './ui/screens/splash/SplashScreen';
const SignedInNavigator = createStackNavigator({
Welcome,
Event,
Profile,
Pizza,
Registration,
}, {
initialRouteName: 'MainNavigator',
headerMode: 'none',
});
const AppNavigator = createSwitchNavigator({
Splash: SplashScreen,
Auth: Login,
SignedIn: SignedInNavigator,
});
let navigator;
function setTopLevelNavigator(navigatorRef) {
navigator = navigatorRef;
}
function navigate(routeName, params) {
navigator.dispatch(
NavigationActions.navigate({
routeName,
params,
}),
);
}
export default {
AppNavigator,
navigate,
setTopLevelNavigator,
};
......@@ -8,8 +8,7 @@ import { Sentry } from 'react-native-sentry';
import { apiRequest, tokenSelector } from '../utils/url';
import * as sessionActions from '../actions/session';
import * as pushNotificationsActions from '../actions/pushNotifications';
import { navigate } from '../actions/navigation';
import { LOGIN_SCENE, WELCOME_SCENE } from '../ui/components/navigator/scenes';
import NavigationService from '../navigation';
export const USERNAMEKEY = '@MyStore:username';
export const TOKENKEY = '@MyStore:token';
......@@ -44,7 +43,7 @@ function* init() {
yield put(sessionActions.fetchUserInfo());
yield put(pushNotificationsActions.register(pushCategories));
} else {
yield put(navigate(LOGIN_SCENE, true));
yield call(NavigationService.navigate, 'Auth');
}
} catch (e) {
Sentry.captureException(e);
......@@ -95,7 +94,7 @@ function* signOut() {
function* signedIn({ payload }) {
const { username } = payload;
yield put(navigate(WELCOME_SCENE, true));
yield call(NavigationService.navigate, 'SignedIn');
yield call(Sentry.setUserContext, { username });
}
......
......@@ -1785,6 +1785,10 @@ circular-json@^0.3.1:
version "0.3.3"
resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
clamp@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/clamp/-/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634"
class-utils@^0.3.5:
version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
......@@ -2004,6 +2008,13 @@ create-react-class@^15.6.3:
loose-envify "^1.3.1"
object-assign "^4.1.1"
create-react-context@^0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca"
dependencies:
fbjs "^0.8.0"
gud "^1.0.0"
cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
......@@ -2721,7 +2732,7 @@ fbjs@0.8.16:
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"
fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9:
fbjs@^0.8.0, fbjs@^0.8.14, fbjs@^0.8.16, fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
dependencies:
......@@ -3070,6 +3081,10 @@ growly@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
gud@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
gulp-sort@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/gulp-sort/-/gulp-sort-2.0.0.tgz#c6762a2f1f0de0a3fc595a21599d3fac8dba1aca"
......@@ -3152,10 +3167,14 @@ has@^1.0.1, has@^1.0.3:
dependencies:
function-bind "^1.1.1"
hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0:
hoist-non-react-statics@^2.2.0, hoist-non-react-statics@^2.3.1:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
hoist-non-react-statics@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
......@@ -5057,6 +5076,12 @@ path-parse@^1.0.5:
version "1.0.6"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
isarray "0.0.1"
path-type@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
......@@ -5201,7 +5226,7 @@ prompts@^0.1.9:
kleur "^2.0.1"
sisteransi "^0.1.1"
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.2:
prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
dependencies:
......@@ -5247,6 +5272,13 @@ qs@~6.5.1:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
query-string@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a"
dependencies:
decode-uri-component "^0.2.0"
strict-uri-encode "^2.0.0"
r2@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/r2/-/r2-2.0.1.tgz#94cd802ecfce9a622549c8182032d8e4a2b2e612"
......@@ -5307,12 +5339,32 @@ react-is@^16.4.2:
version "16.4.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.4.2.tgz#84891b56c2b6d9efdee577cc83501dfc5ecead88"
react-lifecycles-compat@^3, react-lifecycles-compat@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
react-native-dismiss-keyboard@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/react-native-dismiss-keyboard/-/react-native-dismiss-keyboard-1.0.0.tgz#32886242b3f2317e121f3aeb9b0a585e2b879b49"
react-native-dotenv@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/react-native-dotenv/-/react-native-dotenv-0.2.0.tgz#311551cb6a35a3dcfede648bded55c0e3ece579d"
dependencies:
babel-plugin-dotenv "0.1.1"
react-native-drawer-layout-polyfill@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-drawer-layout-polyfill/-/react-native-drawer-layout-polyfill-1.3.2.tgz#192c84d7a5a6b8a6d2be2c7daa5e4164518d0cc7"
dependencies:
react-native-drawer-layout "1.3.2"
react-native-drawer-layout@1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/react-native-drawer-layout/-/react-native-drawer-layout-1.3.2.tgz#b9740d7663a1dc4f88a61b9c6d93d2d948ea426e"
dependencies:
react-native-dismiss-keyboard "1.0.0"
react-native-drawer@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/react-native-drawer/-/react-native-drawer-2.5.0.tgz#022cba5c0516126a9fc9cce3185cb46c644b51c4"
......@@ -5360,6 +5412,18 @@ react-native-render-html@^3.10.0:
htmlparser2 "^3.9.0"
stream "0.0.2"
react-native-safe-area-view@^0.7.0:
version "0.7.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.7.0.tgz#38f5ab9368d6ef9e5d18ab64212938af3ec39421"
dependencies:
hoist-non-react-statics "^2.3.1"
react-native-safe-area-view@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.8.0.tgz#22d78cb8e8658d04a10cd53c1546e0bc86cb7aea"
dependencies:
hoist-non-react-statics "^2.3.1"
react-native-sentry@^0.38.2:
version "0.38.3"
resolved "https://registry.yarnpkg.com/react-native-sentry/-/react-native-sentry-0.38.3.tgz#2ab72786b8755a806c0774ec4a47ac8dd595fb8c"
......@@ -5371,6 +5435,18 @@ react-native-snackbar@^0.4.7:
version "0.4.7"
resolved "https://registry.yarnpkg.com/react-native-snackbar/-/react-native-snackbar-0.4.7.tgz#051a63da5a6dfcf9bbe3852f2165d366a42c6fb4"
react-native-tab-view@^0.0.77:
version "0.0.77"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-0.0.77.tgz#11ceb8e7c23100d07e628dc151b57797524d00d4"
dependencies:
prop-types "^15.6.0"
react-native-tab-view@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-1.0.2.tgz#66e0bc6d38a227ed2b212e3a256b7902f6ce02ed"
dependencies:
prop-types "^15.6.1"
react-native-vector-icons@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-4.6.0.tgz#e4014311ffa6de397d914ffc31b7097a874cc8d5"
......@@ -5435,6 +5511,43 @@ react-native@0.56.0:
xmldoc "^0.4.0"
yargs "^9.0.0"
react-navigation-deprecated-tab-navigator@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-navigation-deprecated-tab-navigator/-/react-navigation-deprecated-tab-navigator-1.3.0.tgz#015dcae1e977b984ca7e99245261c15439026bb7"
dependencies:
react-native-tab-view "^0.0.77"
react-navigation-drawer@0.4.3:
version "0.4.3"
resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-0.4.3.tgz#c04c94e2429b7e724801af05bd0a93a79cb27f71"
dependencies:
react-native-drawer-layout-polyfill "^1.3.2"
react-navigation-tabs@0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.5.1.tgz#ed33bce3a3e21b92646700de25bd94b8fc570371"
dependencies:
hoist-non-react-statics "^2.5.0"
prop-types "^15.6.1"
react-lifecycles-compat "^3.0.4"
react-native-safe-area-view "^0.7.0"
react-native-tab-view "^1.0.0"
react-navigation@^2.9.3:
version "2.9.3"
resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.9.3.tgz#de97f7102df6b836af780bfa5bfa80747148da19"
dependencies:
clamp "^1.0.1"
create-react-context "^0.2.1"
hoist-non-react-statics "^2.2.0"
path-to-regexp "^1.7.0"
query-string "^6.1.0"
react-lifecycles-compat "^3"
react-native-safe-area-view "^0.8.0"
react-navigation-deprecated-tab-navigator "1.3.0"
react-navigation-drawer "0.4.3"
react-navigation-tabs "0.5.1"
react-proxy@^1.1.7:
version "1.1.8"
resolved "https://registry.yarnpkg.com/react-proxy/-/react-proxy-1.1.8.tgz#9dbfd9d927528c3aa9f444e4558c37830ab8c26a"
......@@ -6198,6 +6311,10 @@ stream@0.0.2:
dependencies:
emitter-component "^1.1.1"
strict-uri-encode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
string-length@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed"
......@@ -6477,10 +6594,14 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
ua-parser-js@^0.7.18, ua-parser-js@^0.7.9:
ua-parser-js@^0.7.18:
version "0.7.18"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed"
ua-parser-js@^0.7.9:
version "0.7.17"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac"
uglify-es@^3.1.9:
version "3.3.9"
resolved "https://registry.yarnpkg.com/uglify-es/-/uglify-es-3.3.9.tgz#0c1c4f0700bed8dbc124cdb304d2592ca203e677"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment