Update react-navigation

parent af05411a
...@@ -147,6 +147,7 @@ android { ...@@ -147,6 +147,7 @@ android {
} }
dependencies { dependencies {
implementation project(':react-native-gesture-handler')
implementation project(':react-native-sentry') implementation project(':react-native-sentry')
implementation project(':react-native-locale-detector') implementation project(':react-native-locale-detector')
implementation project(':react-native-vector-icons') implementation project(':react-native-vector-icons')
......
package com.thaliapp; package com.thaliapp;
import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
public class MainActivity extends ReactActivity { public class MainActivity extends ReactActivity {
...@@ -12,4 +15,14 @@ public class MainActivity extends ReactActivity { ...@@ -12,4 +15,14 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() { protected String getMainComponentName() {
return "ThaliApp"; return "ThaliApp";
} }
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
} }
...@@ -3,6 +3,7 @@ package com.thaliapp; ...@@ -3,6 +3,7 @@ package com.thaliapp;
import android.app.Application; import android.app.Application;
import com.facebook.react.ReactApplication; import com.facebook.react.ReactApplication;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import cl.json.ShareApplication; import cl.json.ShareApplication;
import cl.json.RNSharePackage; import cl.json.RNSharePackage;
...@@ -35,6 +36,7 @@ public class MainApplication extends Application implements ShareApplication, Re ...@@ -35,6 +36,7 @@ public class MainApplication extends Application implements ShareApplication, Re
protected List<ReactPackage> getPackages() { protected List<ReactPackage> getPackages() {
return Arrays.asList( return Arrays.asList(
new MainReactPackage(), new MainReactPackage(),
new RNGestureHandlerPackage(),
new RNSharePackage(), new RNSharePackage(),
new RNSentryPackage(), new RNSentryPackage(),
new SnackbarPackage(), new SnackbarPackage(),
......
rootProject.name = 'ThaliApp' rootProject.name = 'ThaliApp'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-share' include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android') project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')
include ':react-native-sentry' include ':react-native-sentry'
......
...@@ -109,7 +109,7 @@ class Main extends Component { ...@@ -109,7 +109,7 @@ class Main extends Component {
return ( return (
<I18nextProvider i18n={i18n}> <I18nextProvider i18n={i18n}>
<Provider store={store}> <Provider store={store}>
<NavigationService.AppNavigator <NavigationService.AppContainer
ref={(navigatorRef) => { ref={(navigatorRef) => {
NavigationService.setTopLevelNavigator(navigatorRef); NavigationService.setTopLevelNavigator(navigatorRef);
}} }}
......
...@@ -2,6 +2,7 @@ import { ...@@ -2,6 +2,7 @@ import {
createDrawerNavigator, createDrawerNavigator,
createStackNavigator, createStackNavigator,
createSwitchNavigator, createSwitchNavigator,
createAppContainer,
NavigationActions, NavigationActions,
DrawerActions, DrawerActions,
} from 'react-navigation'; } from 'react-navigation';
...@@ -45,6 +46,8 @@ const AppNavigator = createSwitchNavigator({ ...@@ -45,6 +46,8 @@ const AppNavigator = createSwitchNavigator({
SignedIn: SignedInNavigator, SignedIn: SignedInNavigator,
}); });
const AppContainer = createAppContainer(AppNavigator);
let navigator; let navigator;
function setTopLevelNavigator(navigatorRef) { function setTopLevelNavigator(navigatorRef) {
...@@ -73,7 +76,7 @@ function toggleDrawer() { ...@@ -73,7 +76,7 @@ function toggleDrawer() {
} }
export default { export default {
AppNavigator, AppContainer,
navigate, navigate,
goBack, goBack,
toggleDrawer, toggleDrawer,
......
...@@ -9,6 +9,8 @@ target 'ThaliApp' do ...@@ -9,6 +9,8 @@ target 'ThaliApp' do
pod 'Firebase/Core', '~> 5.20.1' pod 'Firebase/Core', '~> 5.20.1'
pod 'Firebase/Messaging', '~> 5.20.1' pod 'Firebase/Messaging', '~> 5.20.1'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
target 'ThaliAppTests' do target 'ThaliAppTests' do
inherit! :search_paths inherit! :search_paths
# Pods for testing # Pods for testing
......
...@@ -31,7 +31,8 @@ ...@@ -31,7 +31,8 @@
".yarn/" ".yarn/"
], ],
"setupFiles": [ "setupFiles": [
"<rootDir>/__tests__/setup.js" "<rootDir>/__tests__/setup.js",
"<rootDir>/node_modules/react-native-gesture-handler/jestSetup.js"
], ],
"testPathIgnorePatterns": [ "testPathIgnorePatterns": [
"<rootDir>/__tests__/setup.js" "<rootDir>/__tests__/setup.js"
...@@ -40,7 +41,7 @@ ...@@ -40,7 +41,7 @@
"^.+\\.js$": "<rootDir>/jest/preprocessor.js" "^.+\\.js$": "<rootDir>/jest/preprocessor.js"
}, },
"transformIgnorePatterns": [ "transformIgnorePatterns": [
"node_modules/(?!react-native|react-navigation|i18next-react-native-language-detector|react-navigation-drawer/)" "node_modules/(?!react-native|@react-navigation|i18next-react-native-language-detector|react-navigation-drawer|react-navigation-stack/)"
], ],
"moduleNameMapper": { "moduleNameMapper": {
"react-i18next": "<rootDir>/__mocks__/react-i18next-mock.js" "react-i18next": "<rootDir>/__mocks__/react-i18next-mock.js"
...@@ -59,14 +60,15 @@ ...@@ -59,14 +60,15 @@
"react-native": "0.59.8", "react-native": "0.59.8",
"react-native-dotenv": "0.2.0", "react-native-dotenv": "0.2.0",
"react-native-firebase": "5.4.0", "react-native-firebase": "5.4.0",
"react-native-gesture-handler": "1.2.1",
"react-native-linear-gradient": "2.5.4", "react-native-linear-gradient": "2.5.4",
"react-native-locale-detector": "1.0.1", "react-native-locale-detector": "1.0.1",
"react-native-render-html": "4.1.2", "react-native-render-html": "4.1.2",
"react-native-sentry": "0.43.1", "react-native-sentry": "0.43.1",
"react-native-share": "1.1.3", "react-native-share": "1.1.3",
"react-native-snackbar": "^0.5.5", "react-native-snackbar": "0.5.5",
"react-native-vector-icons": "6.4.2", "react-native-vector-icons": "6.4.2",
"react-navigation": "2.18.3", "react-navigation": "^3.11.0",
"react-redux": "5.1.1", "react-redux": "5.1.1",
"redux": "4.0.1", "redux": "4.0.1",
"redux-saga": "0.16.2" "redux-saga": "0.16.2"
......
This diff is collapsed.
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