diff --git a/android/app/build.gradle b/android/app/build.gradle index 3e72cb7559..e3e5a808d7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -180,6 +180,7 @@ configurations.all { dependencies { compile project(':react-native-gesture-handler') compile project(':react-native-open-settings') + compile project(':react-native-screens') compile project(':react-native-config') compile project(':react-native-svg') compile project(':@ledgerhq_react-native-hid') diff --git a/android/app/src/main/java/com/ledgerlivemobile/MainActivity.java b/android/app/src/main/java/com/ledgerlivemobile/MainActivity.java index b9aae8ceac..43bc6ba12d 100644 --- a/android/app/src/main/java/com/ledgerlivemobile/MainActivity.java +++ b/android/app/src/main/java/com/ledgerlivemobile/MainActivity.java @@ -2,7 +2,7 @@ import android.os.Bundle; -import com.facebook.react.ReactActivity; +import com.facebook.react.ReactFragmentActivity; import org.devio.rn.splashscreen.SplashScreen; import com.facebook.react.ReactActivityDelegate; @@ -10,7 +10,7 @@ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; -public class MainActivity extends ReactActivity { +public class MainActivity extends ReactFragmentActivity { /** * Returns the name of the main component registered from JavaScript. diff --git a/android/app/src/main/java/com/ledgerlivemobile/MainApplication.java b/android/app/src/main/java/com/ledgerlivemobile/MainApplication.java index ac49dd751b..e6a3b35f18 100644 --- a/android/app/src/main/java/com/ledgerlivemobile/MainApplication.java +++ b/android/app/src/main/java/com/ledgerlivemobile/MainApplication.java @@ -5,6 +5,7 @@ import com.facebook.react.ReactApplication; import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; import com.opensettings.OpenSettingsPackage; +import com.swmansion.rnscreens.RNScreenPackage; import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; import com.horcrux.svg.SvgPackage; import com.ledgerwallet.hid.ReactHIDPackage; @@ -36,6 +37,7 @@ protected List getPackages() { new MainReactPackage(), new RNGestureHandlerPackage(), new OpenSettingsPackage(), + new RNScreenPackage(), new ReactNativeConfigPackage(), new SvgPackage(), new ReactHIDPackage(), diff --git a/android/settings.gradle b/android/settings.gradle index c55577609a..59f2e826a0 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -3,6 +3,8 @@ 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-open-settings' project(':react-native-open-settings').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-open-settings/android') +include ':react-native-screens' +project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android') include ':react-native-config' project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android') include ':react-native-svg' diff --git a/ios/ledgerlivemobile.xcodeproj/project.pbxproj b/ios/ledgerlivemobile.xcodeproj/project.pbxproj index 7950d25773..2042dc3266 100644 --- a/ios/ledgerlivemobile.xcodeproj/project.pbxproj +++ b/ios/ledgerlivemobile.xcodeproj/project.pbxproj @@ -70,6 +70,7 @@ D38D9E8A1BA34222AFFD6469 /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C3CB4695C9554CACBA1EDD1F /* Octicons.ttf */; }; D5C1F1874ECE48F4AA5693AF /* MuseoSans-SemiBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = CEDB8CDC561E4D4BBA7A64CD /* MuseoSans-SemiBold.otf */; }; DEF1B1546B36491B9894A599 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 545FD04868AD450083DC4717 /* libz.tbd */; }; + FD935BBB77A24B79B2604726 /* libRNScreens.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 35AA9FCF9B3A4E54A2282A09 /* libRNScreens.a */; }; FEA0D6AE27DE42709BBB7FC7 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CD5489262AA84BDF9684E3AA /* Foundation.ttf */; }; /* End PBXBuildFile section */ @@ -165,6 +166,13 @@ remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32; remoteInfo = "fishhook-tvOS"; }; + 34532BFD2159525400CA371F /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1A6A2D21459F426EA996EA88 /* RNScreens.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RNScreens; + }; 345C15652089152000A0E797 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = EE89361C161C48FB98136880 /* PasscodeAuth.xcodeproj */; @@ -446,9 +454,11 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ledgerlivemobile/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ledgerlivemobile/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 1A6A2D21459F426EA996EA88 /* RNScreens.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNScreens.xcodeproj; path = "../node_modules/react-native-screens/ios/RNScreens.xcodeproj"; sourceTree = ""; }; 2CB99C7AA791411C87B310E9 /* ReactNativeConfig.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = ReactNativeConfig.xcodeproj; path = "../node_modules/react-native-config/ios/ReactNativeConfig.xcodeproj"; sourceTree = ""; }; 3263CCC7104E4B86AC2ADDB4 /* MuseoSans-Regular.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "MuseoSans-Regular.otf"; path = "../assets/fonts/MuseoSans-Regular.otf"; sourceTree = ""; }; 349F66542045ADCC002149B4 /* RNCamera.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNCamera.xcodeproj; path = "../node_modules/react-native-camera/ios/RNCamera.xcodeproj"; sourceTree = ""; }; + 35AA9FCF9B3A4E54A2282A09 /* libRNScreens.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNScreens.a; sourceTree = ""; }; 3A45C4CF346C4C9594B2EC36 /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = ""; }; 3E46E77C7D524ECDB200DA38 /* RNGestureHandler.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNGestureHandler.xcodeproj; path = "../node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj"; sourceTree = ""; }; 4396DC4264644851ADA99A35 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = MaterialCommunityIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = ""; }; @@ -546,6 +556,7 @@ 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, DEF1B1546B36491B9894A599 /* libz.tbd in Frameworks */, 7EDEA35621D64751B73F49C7 /* libReact Native Open Settings.a in Frameworks */, + FD935BBB77A24B79B2604726 /* libRNScreens.a in Frameworks */, C1E2A1AC36C040B689A72E76 /* libRNGestureHandler.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -693,10 +704,19 @@ 3A45C4CF346C4C9594B2EC36 /* libRNVectorIcons.a */, 88F6163E74364066BC1A5713 /* libReact Native Open Settings.a */, 76B12D3F99F7436CAD186C2C /* libRNGestureHandler.a */, + 35AA9FCF9B3A4E54A2282A09 /* libRNScreens.a */, ); name = "Recovered References"; sourceTree = ""; }; + 34532BFA2159525400CA371F /* Products */ = { + isa = PBXGroup; + children = ( + 34532BFE2159525400CA371F /* libRNScreens.a */, + ); + name = Products; + sourceTree = ""; + }; 345C15612089152000A0E797 /* Products */ = { isa = PBXGroup; children = ( @@ -825,6 +845,7 @@ EE89361C161C48FB98136880 /* PasscodeAuth.xcodeproj */, 4AD2AECC687D45E9BBCCED05 /* RNVectorIcons.xcodeproj */, A49125B8906C40DFB2011F37 /* React Native Open Settings.xcodeproj */, + 1A6A2D21459F426EA996EA88 /* RNScreens.xcodeproj */, 3E46E77C7D524ECDB200DA38 /* RNGestureHandler.xcodeproj */, ); name = Libraries; @@ -1068,6 +1089,10 @@ ProductGroup = 34DE44012155286100259C93 /* Products */; ProjectRef = 3E46E77C7D524ECDB200DA38 /* RNGestureHandler.xcodeproj */; }, + { + ProductGroup = 34532BFA2159525400CA371F /* Products */; + ProjectRef = 1A6A2D21459F426EA996EA88 /* RNScreens.xcodeproj */; + }, { ProductGroup = 347AB1EC2049885900BE6F60 /* Products */; ProjectRef = 64C6A31B337D471B93E32DCD /* RNSentry.xcodeproj */; @@ -1182,6 +1207,13 @@ remoteRef = 34457ED02003A12500415724 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 34532BFE2159525400CA371F /* libRNScreens.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNScreens.a; + remoteRef = 34532BFD2159525400CA371F /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 345C15662089152000A0E797 /* libPasscodeAuth.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1593,6 +1625,7 @@ "$(SRCROOT)/../node_modules/@ledgerhq/react-native-passcode-auth", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-open-settings", + "$(SRCROOT)/../node_modules/react-native-screens/ios", "$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**", ); INFOPLIST_FILE = ledgerlivemobileTests/Info.plist; @@ -1634,6 +1667,7 @@ "$(SRCROOT)/../node_modules/@ledgerhq/react-native-passcode-auth", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-open-settings", + "$(SRCROOT)/../node_modules/react-native-screens/ios", "$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**", ); INFOPLIST_FILE = ledgerlivemobileTests/Info.plist; @@ -1679,6 +1713,7 @@ "$(SRCROOT)/../node_modules/@ledgerhq/react-native-passcode-auth", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-open-settings", + "$(SRCROOT)/../node_modules/react-native-screens/ios", "$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**", ); INFOPLIST_FILE = ledgerlivemobile/Info.plist; @@ -1721,6 +1756,7 @@ "$(SRCROOT)/../node_modules/@ledgerhq/react-native-passcode-auth", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-open-settings", + "$(SRCROOT)/../node_modules/react-native-screens/ios", "$(SRCROOT)/../node_modules/react-native-gesture-handler/ios/**", ); INFOPLIST_FILE = ledgerlivemobile/Info.plist; diff --git a/package.json b/package.json index 7611af37e0..606ea28728 100644 --- a/package.json +++ b/package.json @@ -67,13 +67,14 @@ "react-native-open-settings": "^1.0.1", "react-native-progress": "^3.5.0", "react-native-qrcode-svg": "5.1.0", + "react-native-screens": "^1.0.0-alpha.11", "react-native-sentry": "0.39.0", "react-native-simple-store": "1.3.0", "react-native-splash-screen": "3.1.1", "react-native-svg": "6.5.2", "react-native-touch-id": "4.0.4", "react-native-vector-icons": "^5.0.0", - "react-navigation": "2.9.3", + "react-navigation": "2.14.2", "react-navigation-tabs": "^0.6.0", "react-redux": "5.0.7", "redux": "4.0.0", diff --git a/src/index.js b/src/index.js index f7e1953d22..f105745248 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import "./polyfill"; /* eslint-disable import/first */ import React, { Component } from "react"; import { StyleSheet, View } from "react-native"; +import { useScreens } from "react-native-screens"; import SplashScreen from "react-native-splash-screen"; import { exportSelector as settingsExportSelector } from "./reducers/settings"; import { exportSelector as accountsExportSelector } from "./reducers/accounts"; @@ -18,6 +19,8 @@ import StyledStatusBar from "./components/StyledStatusBar"; import { BridgeSyncProvider } from "./bridge/BridgeSyncContext"; import DBSave from "./components/DBSave"; +useScreens(); + const styles = StyleSheet.create({ root: { flex: 1, diff --git a/yarn.lock b/yarn.lock index 9bae76661c..45cadca8b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2450,7 +2450,7 @@ create-react-class@^15.5.2, create-react-class@^15.5.3, create-react-class@^15.6 loose-envify "^1.3.1" object-assign "^4.1.1" -create-react-context@0.2.2, create-react-context@^0.2.1: +create-react-context@0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca" dependencies: @@ -6722,17 +6722,21 @@ react-native-qrcode-svg@5.1.0: prop-types "^15.5.10" qrcode "^1.2.0" +react-native-safe-area-view@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.10.0.tgz#e8e9228d22698c0f82ad1202d24a4e4977260489" + dependencies: + hoist-non-react-statics "^2.3.1" + 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-screens@^1.0.0-alpha.10, react-native-screens@^1.0.0-alpha.11: + version "1.0.0-alpha.11" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.11.tgz#4f4faeb5607b1e08cc70d76a04c2f8da0b241200" react-native-sentry@0.39.0: version "0.39.0" @@ -6845,20 +6849,25 @@ react-navigation-deprecated-tab-navigator@1.3.0: 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" +react-navigation-drawer@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-0.5.0.tgz#d91b6a6ec65c34ba78c00f814b1e6508922cc9ec" dependencies: react-native-drawer-layout-polyfill "^1.3.2" -react-navigation-tabs@0.5.1: +react-navigation-stack@0.5.1: version "0.5.1" - resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.5.1.tgz#ed33bce3a3e21b92646700de25bd94b8fc570371" + resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.5.1.tgz#acc3c84c7b5209c7d89380d7f4576f17624f683c" + dependencies: + react-native-screens "^1.0.0-alpha.10" + +react-navigation-tabs@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.7.0.tgz#c89d41e501043f7fdb38550de85814452c3e6104" 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-tabs@^0.6.0: @@ -6871,20 +6880,21 @@ react-navigation-tabs@^0.6.0: 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" +react-navigation@2.14.2: + version "2.14.2" + resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.14.2.tgz#e3c933b15efdc6bcb1e9b014aeacfb2a08997d5b" dependencies: clamp "^1.0.1" - create-react-context "^0.2.1" + create-react-context "0.2.2" 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-native-safe-area-view "^0.10.0" react-navigation-deprecated-tab-navigator "1.3.0" - react-navigation-drawer "0.4.3" - react-navigation-tabs "0.5.1" + react-navigation-drawer "0.5.0" + react-navigation-stack "0.5.1" + react-navigation-tabs "0.7.0" react-proxy@^1.1.7: version "1.1.8"