diff --git a/android/app/build.gradle b/android/app/build.gradle index f091d40fa8..58eae8d0b7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -279,6 +279,7 @@ dependencies { implementation project(':react-native-config') implementation project(':react-native-firebase') implementation project(':react-native-shake') + implementation project(':react-native-gesture-handler') implementation project(':RNMail') compile ('com.google.android.gms:play-services-base:16.0.1') { force = true diff --git a/android/app/src/main/java/im/status/ethereum/MainActivity.java b/android/app/src/main/java/im/status/ethereum/MainActivity.java index f42ef68e20..d4fc596b1c 100644 --- a/android/app/src/main/java/im/status/ethereum/MainActivity.java +++ b/android/app/src/main/java/im/status/ethereum/MainActivity.java @@ -21,6 +21,9 @@ import android.content.SharedPreferences; import android.content.res.Configuration; import android.provider.Settings; import android.os.Bundle; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.ReactRootView; +import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; import com.facebook.react.ReactActivity; import com.facebook.react.modules.core.PermissionListener; @@ -230,4 +233,14 @@ public class MainActivity extends ReactActivity com.github.alinz.reactnativewebviewbridge.WebViewBridgeManager.grantAccess(requestCode); } } + + @Override + protected ReactActivityDelegate createReactActivityDelegate() { + return new ReactActivityDelegate(this, getMainComponentName()) { + @Override + protected ReactRootView createRootView() { + return new RNGestureHandlerEnabledRootView(MainActivity.this); + } + }; + } } diff --git a/android/app/src/main/java/im/status/ethereum/MainApplication.java b/android/app/src/main/java/im/status/ethereum/MainApplication.java index 179a52628a..f9597fff0c 100644 --- a/android/app/src/main/java/im/status/ethereum/MainApplication.java +++ b/android/app/src/main/java/im/status/ethereum/MainApplication.java @@ -38,6 +38,7 @@ import io.realm.react.RealmReactPackage; import me.alwx.HttpServer.HttpServerReactPackage; import com.chirag.RNMail.*; import com.clipsub.RNShake.RNShakeEventPackage; +import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; public class MainApplication extends MultiDexApplication implements ReactApplication { @@ -76,7 +77,8 @@ public class MainApplication extends MultiDexApplication implements ReactApplica new ReactNativeConfigPackage(), new KeychainPackage(), new RNShakeEventPackage(), - new FingerprintAuthPackage()); + new FingerprintAuthPackage(), + new RNGestureHandlerPackage()); } @Override diff --git a/android/settings.gradle b/android/settings.gradle index ca49acc3c5..79a14ae4e3 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -48,3 +48,5 @@ include ':RNMail', ':app' project(':RNMail').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-mail/android') include ':react-native-shake' project(':react-native-shake').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-shake/android') +include ':react-native-gesture-handler' +project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') diff --git a/externs.js b/externs.js index 2f914c1940..c2be1eefc8 100644 --- a/externs.js +++ b/externs.js @@ -559,5 +559,6 @@ var TopLevel = { "decimalPlaces": function () {}, "_android": function () {}, "isSupported" : function () {}, - "authenticate" : function () {} + "authenticate" : function () {}, + "createAppContainer" : function () {} } diff --git a/ios/StatusIm.xcodeproj/project.pbxproj b/ios/StatusIm.xcodeproj/project.pbxproj index 6159dd1a87..2c441f700b 100644 --- a/ios/StatusIm.xcodeproj/project.pbxproj +++ b/ios/StatusIm.xcodeproj/project.pbxproj @@ -33,6 +33,7 @@ 42B30EAD0EED4C72BB96D1AB /* Inter-ExtraBold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 6B145D55D500476BB45C2232 /* Inter-ExtraBold.otf */; }; 475D202F20B7450D00879A77 /* libRNFirebase.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 475D1FC020B7413500879A77 /* libRNFirebase.a */; }; 4C16DE0C1F89508700AA10DB /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */; }; + 4C24F03522B12D6E009A5636 /* libRNGestureHandler.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C24F02922B12D19009A5636 /* libRNGestureHandler.a */; }; 4C5F69C322815E6A00D26222 /* libRNShakeEvent.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C5F69BE22815E4F00D26222 /* libRNShakeEvent.a */; }; 4C9FBC56227C85640024181F /* libRNMail.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C9FBC50227C85250024181F /* libRNMail.a */; }; 54BD2CE922134B6291FE1BFD /* Inter-Light-BETA.otf in Resources */ = {isa = PBXBuildFile; fileRef = 6864A92FD6844B928C52F5C1 /* Inter-Light-BETA.otf */; }; @@ -189,6 +190,20 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RNFirebase; }; + 4C24F02822B12D19009A5636 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4C24EFF322B12D0D009A5636 /* RNGestureHandler.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RNGestureHandler; + }; + 4C24F02A22B12D19009A5636 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4C24EFF322B12D0D009A5636 /* RNGestureHandler.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = B5C32A36220C603B000FFB8D; + remoteInfo = "RNGestureHandler-tvOS"; + }; 4C5F69BD22815E4F00D26222 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 4C5F698522815E4E00D26222 /* RNShakeEvent.xcodeproj */; @@ -564,6 +579,7 @@ 475D1FCD20B7415300879A77 /* libFirebaseCore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libFirebaseCore.a; sourceTree = BUILT_PRODUCTS_DIR; }; 475D1FCE20B7415300879A77 /* libFirebaseMessaging.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libFirebaseMessaging.a; sourceTree = BUILT_PRODUCTS_DIR; }; 4C16DE0B1F89508700AA10DB /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + 4C24EFF322B12D0D009A5636 /* RNGestureHandler.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNGestureHandler.xcodeproj; path = "../node_modules/react-native-gesture-handler/ios/RNGestureHandler.xcodeproj"; sourceTree = ""; }; 4C5F698522815E4E00D26222 /* RNShakeEvent.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNShakeEvent.xcodeproj; path = "../node_modules/react-native-shake/ios/RNShakeEvent.xcodeproj"; sourceTree = ""; }; 4C9FBC19227C85250024181F /* RNMail.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNMail.xcodeproj; path = "../node_modules/react-native-mail/RNMail.xcodeproj"; sourceTree = ""; }; 4E586E1B0E544F64AA9F5BD1 /* libz.tbd */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; @@ -638,6 +654,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4C24F03522B12D6E009A5636 /* libRNGestureHandler.a in Frameworks */, 4C5F69C322815E6A00D26222 /* libRNShakeEvent.a in Frameworks */, ABC194E5221009A800EB06E6 /* libRNLanguages.a in Frameworks */, 475D202F20B7450D00879A77 /* libRNFirebase.a in Frameworks */, @@ -901,6 +918,15 @@ name = Products; sourceTree = ""; }; + 4C24EFF422B12D0D009A5636 /* Products */ = { + isa = PBXGroup; + children = ( + 4C24F02922B12D19009A5636 /* libRNGestureHandler.a */, + 4C24F02B22B12D19009A5636 /* libRNGestureHandler-tvOS.a */, + ); + name = Products; + sourceTree = ""; + }; 4C5F698622815E4E00D26222 /* Products */ = { isa = PBXGroup; children = ( @@ -940,6 +966,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 4C24EFF322B12D0D009A5636 /* RNGestureHandler.xcodeproj */, 4C5F698522815E4E00D26222 /* RNShakeEvent.xcodeproj */, 4C9FBC19227C85250024181F /* RNMail.xcodeproj */, ABC194DC2210099B00EB06E6 /* RNLanguages.xcodeproj */, @@ -1331,6 +1358,10 @@ ProductGroup = 20B7D1161D3F74CD00B70F14 /* Products */; ProjectRef = 305F194186D848FDB07AF34C /* RNFS.xcodeproj */; }, + { + ProductGroup = 4C24EFF422B12D0D009A5636 /* Products */; + ProjectRef = 4C24EFF322B12D0D009A5636 /* RNGestureHandler.xcodeproj */; + }, { ProductGroup = ABC194DD2210099B00EB06E6 /* Products */; ProjectRef = ABC194DC2210099B00EB06E6 /* RNLanguages.xcodeproj */; @@ -1474,6 +1505,20 @@ remoteRef = 475D1FBF20B7413500879A77 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 4C24F02922B12D19009A5636 /* libRNGestureHandler.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRNGestureHandler.a; + remoteRef = 4C24F02822B12D19009A5636 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 4C24F02B22B12D19009A5636 /* libRNGestureHandler-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRNGestureHandler-tvOS.a"; + remoteRef = 4C24F02A22B12D19009A5636 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 4C5F69BE22815E4F00D26222 /* libRNShakeEvent.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; diff --git a/mobile_files/package.json.orig b/mobile_files/package.json.orig index 84704bd152..07f5d2c98a 100644 --- a/mobile_files/package.json.orig +++ b/mobile_files/package.json.orig @@ -42,6 +42,7 @@ "react-native-fetch-polyfill": "1.1.2", "react-native-firebase": "git+https://github.com/status-im/react-native-firebase.git#v5.0.0-rc1-status", "react-native-fs": "2.11.15", + "react-native-gesture-handler": "^1.3.0", "react-native-http-bridge": "0.6.1", "react-native-image-crop-picker": "0.18.1", "react-native-image-resizer": "git+https://github.com/status-im/react-native-image-resizer.git#1.0.0-1-status", @@ -64,7 +65,7 @@ "react-native-udp": "git+https://github.com/status-im/react-native-udp.git#v2.3.1-1-status", "react-native-webview": "^5.2.1", "react-native-webview-bridge": "git+https://github.com/status-im/react-native-webview-bridge.git#fix/classnames-colision", - "react-navigation": "^2.12.1", + "react-navigation": "^3.11.0", "realm": "2.28.1", "rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status", "string_decoder": "0.10.31", diff --git a/mobile_files/yarn.lock b/mobile_files/yarn.lock index 8a7430c1ef..01262eb3be 100644 --- a/mobile_files/yarn.lock +++ b/mobile_files/yarn.lock @@ -1012,6 +1012,25 @@ xcode "^2.0.0" xmldoc "^0.4.0" +"@react-navigation/core@~3.4.1": + version "3.4.2" + resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.4.2.tgz#bec563e94fde40fbab3730cdc97f22afbb2a1498" + integrity sha512-7G+iDzLSTeOUU4vVZeRZKJ+Bd7ds7ZxYNqZcB8i0KlBeQEQfR74Ounfu/p0KIEq2RiNnaE3QT7WVP3C87sebzw== + dependencies: + hoist-non-react-statics "^3.3.0" + path-to-regexp "^1.7.0" + query-string "^6.4.2" + react-is "^16.8.6" + +"@react-navigation/native@~3.5.0": + version "3.5.0" + resolved "https://registry.yarnpkg.com/@react-navigation/native/-/native-3.5.0.tgz#f5d16e0845ac26d1147d1caa481f18a00740e7ae" + integrity sha512-TmGOis++ejEXG3sqNJhCSKqB0/qLu3FQgDtO959qpqif36R/diR8SQwJqeSdofoEiK3CepdhFlTCeHdS1/+MsQ== + dependencies: + hoist-non-react-statics "^3.0.1" + react-native-safe-area-view "^0.14.1" + react-native-screens "^1.0.0 || ^1.0.0-alpha" + "@svgr/babel-plugin-add-jsx-attribute@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-4.0.0.tgz#5acf239cd2747b1a36ec7e708de05d914cb9b948" @@ -1926,11 +1945,6 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -clamp@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/clamp/-/clamp-1.0.1.tgz#66a0e64011816e37196828fdc8c8c147312c8634" - integrity sha1-ZqDmQBGBbjcZaCj9yMjBRzEshjQ= - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -2217,14 +2231,6 @@ create-react-class@^15.6.0, create-react-class@^15.6.3: loose-envify "^1.3.1" object-assign "^4.1.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" - integrity sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A== - 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" @@ -2872,7 +2878,7 @@ fbjs-scripts@^1.0.0: semver "^5.1.0" through2 "^2.0.0" -fbjs@^0.8.0, fbjs@^0.8.16, fbjs@^0.8.17, fbjs@^0.8.9: +fbjs@^0.8.16, fbjs@^0.8.17, fbjs@^0.8.9: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -3240,11 +3246,6 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= -gud@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" - integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -3374,11 +3375,18 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoist-non-react-statics@^2.2.0, hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0: +hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0: version "2.5.5" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== +hoist-non-react-statics@^3.0.1, hoist-non-react-statics@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b" + integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA== + dependencies: + react-is "^16.7.0" + home-or-tmp@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" @@ -5350,12 +5358,13 @@ query-string@^5.0.1: object-assign "^4.1.0" strict-uri-encode "^1.0.0" -query-string@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.2.0.tgz#468edeb542b7e0538f9f9b1aeb26f034f19c86e1" - integrity sha512-5wupExkIt8RYL4h/FE+WTg3JHk62e6fFPWtAZA9J5IWK1PfTfKkMS93HBUHcFpeYi9KsY5pFbh+ldvEyaz5MyA== +query-string@^6.4.2: + version "6.7.0" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.7.0.tgz#7e92bf8525140cf8c5ebf500f26716b0de5b7023" + integrity sha512-oQ01H1jrgDRbPq5SjtJF470S418GOrKkds+fpvAt6DQatHXl7bmkaJulHbTIM+QNGtoPpa8f5k9W3Zk50zXRPQ== dependencies: decode-uri-component "^0.2.0" + split-on-first "^1.0.0" strict-uri-encode "^2.0.0" querystring-es3@0.2.1: @@ -5447,17 +5456,12 @@ react-dom@16.4.2: object-assign "^4.1.1" prop-types "^15.6.0" -react-is@^16.5.2: - version "16.7.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz#c1bd21c64f1f1364c6f70695ec02d69392f41bfa" - integrity sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g== - -react-is@^16.8.1: +react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.6: version "16.8.6" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== -react-lifecycles-compat@^3, react-lifecycles-compat@^3.0.4: +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" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== @@ -5498,25 +5502,6 @@ react-native-dialogs@1.0.4: resolved "https://registry.yarnpkg.com/react-native-dialogs/-/react-native-dialogs-1.0.4.tgz#c3bcee4a8a4ca2e97131bd5ffaed8db6ab1dec48" integrity sha512-Q3e4bAPp13jnPkStKYzyE/pb6xVY1spSlGHzq3zljV7uMXqFHjuTBRiM/qfm2bSZplR/znzVS/y2TtcW+1aufQ== -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" - integrity sha1-MohiQrPyMX4SHzrrmwpYXiuHm0k= - -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" - integrity sha512-XzPhfLDJrYHru+e8+dFwhf0FtTeAp7JXPpFYezYV6P1nTeA1Tia/kDpFT+O2DWTrBKBEI8FGhZnThrroZmHIxg== - 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" - integrity sha512-fjO0scqbJUfNu2wuEpvywL7DYLXuCXJ2W/zYhWz986rdLytidbys1QGVvkaszHrb4Y7OqO96mTkgpOcP8KWevw== - dependencies: - react-native-dismiss-keyboard "1.0.0" - react-native-fetch-polyfill@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/react-native-fetch-polyfill/-/react-native-fetch-polyfill-1.1.2.tgz#256b5a0abd78cc4992f7a7cf82543da2f2124a73" @@ -5537,6 +5522,15 @@ react-native-fs@2.11.15: base-64 "^0.1.0" utf8 "^2.1.1" +react-native-gesture-handler@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.3.0.tgz#d0386f565928ccc1849537f03f2e37fd5f6ad43f" + integrity sha512-ASRFIXBuKRvqlmwkWJhV8yP2dTpvcqVrLNpd7FKVBFHYWr6SAxjGyO9Ik8w1lAxDhMlRP2IcJ9p9eq5X2WWeLQ== + dependencies: + hoist-non-react-statics "^2.3.1" + invariant "^2.2.2" + prop-types "^15.5.10" + react-native-http-bridge@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/react-native-http-bridge/-/react-native-http-bridge-0.6.1.tgz#1b85688174870e9b009692e1a6cdc5f5396c5ca4" @@ -5594,13 +5588,6 @@ react-native-randombytes@3.5.0: buffer "^4.9.1" sjcl "^1.0.3" -react-native-safe-area-view@0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174" - integrity sha512-N3nElaahu1Me2ltnfc9acpgt1znm6pi8DSadKy79kvdzKwvVIzw0IXueA/Hjr51eCW1BsfNw7D1SgBT9U6qEkA== - dependencies: - hoist-non-react-statics "^2.3.1" - react-native-safe-area-view@0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.9.0.tgz#10ece2ecac70e7005a5b0b3f06c8833060e6d21f" @@ -5608,10 +5595,17 @@ react-native-safe-area-view@0.9.0: dependencies: hoist-non-react-statics "^2.3.1" -react-native-screens@^1.0.0-alpha.11: - version "1.0.0-alpha.21" - resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.21.tgz#ba8d401e82fa3d0f30e7922dbb6446a8c000d7ef" - integrity sha512-Jm0hfUyEw0v4Rn2rmpG2ab+H2J+36a/505gufMeZQUcx8EajysiuyzNcHQ9B9NhUEUajk/ostF73X4pHuMLItw== +react-native-safe-area-view@^0.14.1: + version "0.14.5" + resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.14.5.tgz#eeded66bbeb0807f0a7f5f449e7fb2871f7ecf76" + integrity sha512-1NxWK1G0gzwCOuyNV/zf4n18s6FWsiqgwkzU3P9C0Iu8AErjhstK1jUqpRwzLH8+/7hGLsrQedmn+ZbQTOrJPg== + dependencies: + hoist-non-react-statics "^2.3.1" + +"react-native-screens@^1.0.0 || ^1.0.0-alpha": + version "1.0.0-alpha.22" + resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b" + integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA== react-native-scrollable-mixin@^1.0.1: version "1.0.1" @@ -5653,17 +5647,10 @@ react-native-svg@^9.2.4: resolved "https://registry.yarnpkg.com/react-native-svg/-/react-native-svg-9.2.4.tgz#a30ee42535b39097e7b68dfa6dcf5c1c8cce97f1" integrity sha512-Gox4iASgWpwgXpmaLgEvzwftjkrT8hIEnxnJvIypZaFlME9fdcgulv4AKcnwTFLxyIrbuuIaY1/GmbU4hejkjg== -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" - integrity sha512-9vjD4Ly1Zlum1Y4g23ODpi/F3gYIUIsKWrsZO/Oh5cuX1eiB1DRVn11nY1z+j/hsQfhfyW6nDlmySyDvYQvYCA== - dependencies: - prop-types "^15.6.0" - -react-native-tab-view@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-1.3.1.tgz#f9932d6bd5ba7dad75ef9335a68f13d85ba5bd56" - integrity sha512-QNt6VkEW8SP1UJ7yjD5P4bOTWwHQfoIMD5CqnA06pcubdNwHR1NmjiNZsVnIvp5wAEVbW6yTHjLXOh1fzab4xg== +react-native-tab-view@^1.2.0, react-native-tab-view@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-1.4.1.tgz#f113cd87485808f0c991abec937f70fa380478b9" + integrity sha512-Bke8KkDcDhvB/z0AS7MnQKMD2p6Kwfc1rSKlMOvg9CC5CnClQ2QEnhPSbwegKDYhUkBI92iH/BYy7hNSm5kbUQ== dependencies: prop-types "^15.6.1" @@ -5763,53 +5750,38 @@ react-native-webview@^5.2.1: 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" - integrity sha512-Cm+qYOPFWbvvcuv0YYX0ioYwLGgw7XAqdhAfpo3sIr3trxRW8871ePmfFOPezjQtz4v6ItjZt6LPgtBAVZoroQ== +react-navigation-drawer@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-1.2.1.tgz#7bd5efeee7d2f611d3ebb0933e0c8e8eb7cafe52" + integrity sha512-T2kaBjY2c4/3I6noWFnaf/c18ntNH5DsST38i+pdc2NPxn5Yi5lkK+ZZTeKuHSFD4a7G0jWY9OGf1iRkHWLMAQ== dependencies: - react-native-tab-view "^0.0.77" + react-native-tab-view "^1.2.0" -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" - integrity sha512-F1y593uC6pqBMGH+Omz75oNODEbxB/s0EGO8QtYwu1NmOOEUuuLA+c14zm+pgMsI4HlDabiHxPkWqsgGz25xVQ== - dependencies: - react-native-drawer-layout-polyfill "^1.3.2" +react-navigation-stack@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.4.0.tgz#69cdb029ea4ee5877d7e933b3117dc90bc841eb2" + integrity sha512-zEe9wCA0Ot8agarYb//0nSWYW1GM+1R0tY/nydUV0EizeJ27At0EklYVWvYEuYU6C48va6cu8OPL7QD/CcJACw== -react-navigation-stack@0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-0.7.0.tgz#0b2f139ee1cba953037ef51353df992ec6c74fa2" - integrity sha512-3Tbb/SsustBrM9R/qaI6XuOfyqYMVbwkeHFC8NbU890vB0aKZvjAtioWLZ18e/4LgbiOCmoTdp37z3gkGDyNDQ== - -react-navigation-tabs@0.8.4: - version "0.8.4" - resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-0.8.4.tgz#aa767f28b899f13c99f2b034b4a665f8cf0a5737" - integrity sha512-CbS3xIVJVtpu+AYslv0PMLmjddJFVtU3XAhSJ9XnMrKLUJNmnQdW/L0w/Gp5qcBEF9h6bgsY3CoTtp7I6bqyOQ== +react-navigation-tabs@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/react-navigation-tabs/-/react-navigation-tabs-1.1.4.tgz#00a312250df3c519c60b7815a523ace5ee11163a" + integrity sha512-py2hLCRxPwXOzmY1W9XcY1rWXxdK6RGW/aXh56G9gIf8cpHNDhy/bJV4e46/JrVcse3ybFaN0liT09/DM/NdwQ== dependencies: hoist-non-react-statics "^2.5.0" prop-types "^15.6.1" react-lifecycles-compat "^3.0.4" - react-native-tab-view "^1.0.0" + react-native-tab-view "^1.4.1" -react-navigation@^2.12.1: - version "2.18.3" - resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-2.18.3.tgz#de9a24dc37dfc33f3e4779a9f13f45ea97dfe19e" - integrity sha512-/5KGMG1Oj5LN/x/7AKF0MWrpX9Qe29307RxEsMCiRT/A4jCYT0DPY99Bl7ZAGtROxExEy3rwTfTrtvpIT+CU7A== +react-navigation@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/react-navigation/-/react-navigation-3.11.0.tgz#2c82217c452d07d8b9b0929bc7e77e2bcfaf9388" + integrity sha512-wlPcDtNiIdPeYxNQ/MN4arY5Xe9EphD2QVpRuvvuPWW+BamF3AJaIy060r3Yz59DODAoWllscabat/yqnih8Tg== dependencies: - clamp "^1.0.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-is "^16.5.2" - react-lifecycles-compat "^3" - react-native-safe-area-view "0.11.0" - react-native-screens "^1.0.0-alpha.11" - react-navigation-deprecated-tab-navigator "1.3.0" - react-navigation-drawer "0.5.0" - react-navigation-stack "0.7.0" - react-navigation-tabs "0.8.4" + "@react-navigation/core" "~3.4.1" + "@react-navigation/native" "~3.5.0" + react-navigation-drawer "~1.2.1" + react-navigation-stack "~1.4.0" + react-navigation-tabs "~1.1.4" react-proxy@^1.1.7: version "1.1.8" @@ -6454,6 +6426,11 @@ spdx-license-ids@^3.0.0: resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" diff --git a/src/status_im/accounts/core.cljs b/src/status_im/accounts/core.cljs index 6bf57e65d0..6dfff05a8a 100644 --- a/src/status_im/accounts/core.cljs +++ b/src/status_im/accounts/core.cljs @@ -41,7 +41,7 @@ (if modal? {:dispatch [:navigate-to-clean :wallet-send-transaction-modal]} (if-not (chat-send? transaction) - (navigation/navigate-to-clean cofx :wallet nil) + (navigation/navigate-to-cofx cofx :wallet nil) (navigation/navigate-to-cofx cofx :wallet-send-transaction-modal nil))))) (fx/defn confirm-wallet-set-up diff --git a/src/status_im/chat/models.cljs b/src/status_im/chat/models.cljs index f1153b5c1c..c8dc6ee174 100644 --- a/src/status_im/chat/models.cljs +++ b/src/status_im/chat/models.cljs @@ -263,13 +263,6 @@ (navigation/navigate-to-cofx :chat-modal {}) (preload-chat-data chat-id)) - navigation-reset? - (fx/merge cofx - (navigation/navigate-reset {:index 1 - :actions [{:routeName :home} - {:routeName :chat}]}) - (preload-chat-data chat-id)) - :else (fx/merge cofx (navigation/navigate-to-cofx :chat {}) diff --git a/src/status_im/contact/block.cljs b/src/status_im/contact/block.cljs index a996be63ea..61f85e1084 100644 --- a/src/status_im/contact/block.cljs +++ b/src/status_im/contact/block.cljs @@ -13,7 +13,7 @@ [{:keys [db] :as cofx}] (fx/merge cofx {:db (dissoc db :current-chat-id)} - (navigation/navigate-to-clean :home {}))) + (navigation/navigate-to-cofx :home {}))) (fx/defn clean-up-chat [{:keys [db] :as cofx} chat-id removed-chat-messages] diff --git a/src/status_im/extensions/registry.cljs b/src/status_im/extensions/registry.cljs index 4cf4785325..acafdee2d3 100644 --- a/src/status_im/extensions/registry.cljs +++ b/src/status_im/extensions/registry.cljs @@ -146,7 +146,7 @@ (fx/merge cofx #(if modal? (navigation/navigate-back %) - (navigation/navigate-to-clean % :my-profile nil)) + (navigation/navigate-to-cofx % :my-profile nil)) #(when-not ephemeral? (fx/merge % (when hooks (accounts.update/account-update {:extensions new-extensions} {})) diff --git a/src/status_im/hardwallet/core.cljs b/src/status_im/hardwallet/core.cljs index e307842615..7c92555d36 100644 --- a/src/status_im/hardwallet/core.cljs +++ b/src/status_im/hardwallet/core.cljs @@ -66,7 +66,7 @@ ;;(wallet/discard-transaction) (navigation/navigate-to-cofx :browser nil)) (if (= :enter-pin-login (:view-id db)) - (navigation/navigate-to-clean cofx :accounts nil) + (navigation/navigate-to-cofx cofx :accounts nil) (fx/merge cofx {:db (assoc-in db [:hardwallet :on-card-connected] nil)} (navigation/navigate-back)))))) diff --git a/src/status_im/ui/screens/add_new/models.cljs b/src/status_im/ui/screens/add_new/models.cljs index b39d5798b2..7358e0b048 100644 --- a/src/status_im/ui/screens/add_new/models.cljs +++ b/src/status_im/ui/screens/add_new/models.cljs @@ -17,6 +17,4 @@ (fx/defn handle-qr-code [cofx data] - (fx/merge cofx - (navigation/navigate-to-clean :home {}) - (process-qr-code data))) + (process-qr-code cofx data)) diff --git a/src/status_im/ui/screens/navigation.cljs b/src/status_im/ui/screens/navigation.cljs index 7f81154812..4707ed7e0c 100644 --- a/src/status_im/ui/screens/navigation.cljs +++ b/src/status_im/ui/screens/navigation.cljs @@ -135,7 +135,7 @@ (handlers/register-handler-fx :navigate-to-clean (fn [cofx [_ view-id params]] - (navigate-to-clean cofx view-id params))) + (navigate-to-cofx cofx view-id params))) (handlers/register-handler-fx :navigate-to-tab diff --git a/src/status_im/ui/screens/routing/core.cljs b/src/status_im/ui/screens/routing/core.cljs index 4c8bd9bce5..b7cae83bf7 100644 --- a/src/status_im/ui/screens/routing/core.cljs +++ b/src/status_im/ui/screens/routing/core.cljs @@ -17,7 +17,8 @@ [status-im.ui.screens.routing.modals :as modals] [status-im.ui.components.bottom-bar.core :as bottom-bar] [status-im.ui.components.status-bar.view :as status-bar] - [status-im.ui.components.bottom-bar.styles :as tabs.styles])) + [status-im.ui.components.bottom-bar.styles :as tabs.styles] + [status-im.react-native.js-dependencies :as js-dependencies])) (defonce view-id (reagent.core/atom nil)) @@ -116,6 +117,9 @@ (cond-> (merge {:headerMode "none" :cardStyle {:backgroundColor (when (or platform/ios? platform/desktop?) :white)} + #_:transitionConfig + #_(fn [] + #js {:transitionSpec #js{:duration 10}}) :onTransitionStart (fn [n] (let [idx (.. n -navigation @@ -183,30 +187,34 @@ [nav] [bottom-bar/bottom-bar nav view-id]) +(defn app-container [navigator] + (.createAppContainer js-dependencies/react-navigation navigator)) + (defn get-main-component [view-id] (log/debug :component view-id) - (switch-navigator - (into {} - [(build-screen (intro-login-stack/login-stack view-id)) - (build-screen (intro-login-stack/intro-stack)) - [:tabs-and-modals - {:screen - (stack-navigator - (merge - {:tabs - {:screen (tab-navigator - (->> [(build-screen chat-stack/chat-stack) - (build-screen browser-stack/browser-stack) - (build-screen wallet-stack/wallet-stack) - (build-screen profile-stack/profile-stack)] - (into {})) - {:initialRouteName :chat-stack - :tabBarComponent (reagent.core/reactify-component - wrap-bottom-bar)})}} - (stack-screens modals/modal-screens)) - {:mode :modal - :initialRouteName :tabs - :onTransitionStart (fn [])})}]]) - {:initialRouteName (if (= view-id :intro) - :intro-stack - :login-stack)})) + (app-container + (switch-navigator + (into {} + [(build-screen (intro-login-stack/login-stack view-id)) + (build-screen (intro-login-stack/intro-stack)) + [:tabs-and-modals + {:screen + (stack-navigator + (merge + {:tabs + {:screen (tab-navigator + (->> [(build-screen chat-stack/chat-stack) + (build-screen browser-stack/browser-stack) + (build-screen wallet-stack/wallet-stack) + (build-screen profile-stack/profile-stack)] + (into {})) + {:initialRouteName :chat-stack + :tabBarComponent (reagent.core/reactify-component + wrap-bottom-bar)})}} + (stack-screens modals/modal-screens)) + {:mode :modal + :initialRouteName :tabs + :onTransitionStart (fn [])})}]]) + {:initialRouteName (if (= view-id :intro) + :intro-stack + :login-stack)}))) diff --git a/src/status_im/ui/screens/routing/modals.cljs b/src/status_im/ui/screens/routing/modals.cljs index 3c44a5919c..3c8737e431 100644 --- a/src/status_im/ui/screens/routing/modals.cljs +++ b/src/status_im/ui/screens/routing/modals.cljs @@ -1,10 +1,12 @@ (ns status-im.ui.screens.routing.modals) (def modal-screens - [{:name :wallet-send-modal-stack - :screens [:hardwallet-connect-modal - :enter-pin-modal] - :config {:initialRouteName :wallet-send-transaction-modal}} + [;; this route is broken after + ;; https://github.com/status-im/status-react/commit/7de2941f26bbfaa4f5948f32dd2ffa4409e1bdcc#diff-290267c339459950d383066cd474a69aL5 + #_{:name :wallet-send-modal-stack + :screens [:hardwallet-connect-modal + :enter-pin-modal] + :config {:initialRouteName :wallet-send-transaction-modal}} {:name :wallet-send-modal-stack-with-onboarding :screens [:wallet-onboarding-setup-modal :hardwallet-connect-modal diff --git a/src/status_im/ui/screens/views.cljs b/src/status_im/ui/screens/views.cljs index e6e30837ad..dfccaeed2b 100644 --- a/src/status_im/ui/screens/views.cljs +++ b/src/status_im/ui/screens/views.cljs @@ -53,6 +53,19 @@ [bottom-sheet/bottom-sheet opts]))) +(defonce state (atom nil)) + +(defn persist-state [state-obj] + (js/Promise. + (fn [resolve reject] + (reset! state state-obj) + (resolve true)))) + +(defn load-state [] + (js/Promise. + (fn [resolve reject] + (resolve @state)))) + (defn main [] (let [view-id (re-frame/subscribe [:view-id]) main-component (atom nil)] @@ -94,14 +107,15 @@ (when (and @view-id main-component) [react/view {:flex 1} [:> @main-component - {:ref (fn [r] - (navigation/set-navigator-ref r) - (when (and - platform/android? - (not js/goog.DEBUG) - (not (contains? #{:intro :login :progress} @view-id))) - (navigation/navigate-to @view-id nil))) + {:ref (fn [r] + (navigation/set-navigator-ref r) + (when (and + platform/android? + (not js/goog.DEBUG) + (not (contains? #{:intro :login :progress} @view-id))) + (navigation/navigate-to @view-id nil))) ;; see https://reactnavigation.org/docs/en/state-persistence.html#development-mode - :persistenceKey (when js/goog.DEBUG rand-label)}] + :persistNavigationState (when js/goog.DEBUG persist-state) + :loadNavigationState (when js/goog.DEBUG load-state)}] [signing/signing] - [bottom-sheet]]))}))) \ No newline at end of file + [bottom-sheet]]))}))) diff --git a/src/status_im/wallet/core.cljs b/src/status_im/wallet/core.cljs index daa5550f8c..7b6b917cd7 100644 --- a/src/status_im/wallet/core.cljs +++ b/src/status_im/wallet/core.cljs @@ -351,4 +351,4 @@ {:events [:wallet.request/set-symbol]} [{:keys [db]} symbol] {:db (-> db - (assoc-in [:wallet :request-transaction :symbol] symbol))}) \ No newline at end of file + (assoc-in [:wallet :request-transaction :symbol] symbol))})