From c5c3e71998ad11f6ce64b52b9b6a47fc1ce55558 Mon Sep 17 00:00:00 2001 From: Philipp Walter Date: Thu, 19 Dec 2024 13:33:05 +0100 Subject: [PATCH] chore: upgrade nav dependencies --- e2e/backup.e2e.js | 1 + e2e/channels.e2e.js | 2 +- ios/Podfile.lock | 18 +- ios/bitkit.xcodeproj/project.pbxproj | 126 +++++++------- package.json | 10 +- .../BottomSheetNavigationHeader.tsx | 11 +- src/components/BottomSheetScreen.tsx | 6 +- src/components/InfoScreen.tsx | 12 +- src/components/NavigationHeader.tsx | 58 ++++--- src/components/OnboardingScreen.tsx | 12 +- src/components/PinPad.tsx | 5 +- .../bottom-sheet/BackupNavigation.tsx | 17 +- .../bottom-sheet/ConnectionClosed.tsx | 5 +- .../bottom-sheet/LNURLWithdrawNavigation.tsx | 45 ++--- .../bottom-sheet/OrangeTicketNavigation.tsx | 45 ++--- src/navigation/bottom-sheet/PINNavigation.tsx | 22 ++- .../bottom-sheet/ProfileLinkNavigation.tsx | 29 ++-- src/navigation/bottom-sheet/PubkyAuth.tsx | 161 ++++++++++-------- .../bottom-sheet/ReceiveNavigation.tsx | 39 +++-- .../bottom-sheet/SendNavigation.tsx | 79 +++++---- .../bottom-sheet/TreasureHuntNavigation.tsx | 49 +++--- src/navigation/settings/SettingsNavigator.tsx | 6 - .../Activity/ActivityAssignContact.tsx | 7 +- src/screens/Activity/ActivityDetail.tsx | 8 +- src/screens/Activity/ActivityFiltered.tsx | 10 +- src/screens/Activity/ActivitySavings.tsx | 1 + src/screens/Activity/ActivitySpending.tsx | 1 + src/screens/AppUpdate.tsx | 1 + src/screens/BuyBitcoin.tsx | 7 +- src/screens/Contacts/AddContact.tsx | 2 +- src/screens/Contacts/Contact.tsx | 8 +- src/screens/Contacts/ContactEdit.tsx | 7 - src/screens/Contacts/Contacts.tsx | 3 - src/screens/Contacts/ContactsOnboarding.tsx | 7 +- src/screens/Onboarding/MultipleDevices.tsx | 1 + src/screens/Onboarding/Passphrase.tsx | 2 +- src/screens/Onboarding/RestoreFromSeed.tsx | 2 +- src/screens/OrangeTicket/Error.tsx | 2 +- src/screens/OrangeTicket/Prize.tsx | 5 +- src/screens/OrangeTicket/UsedCard.tsx | 5 +- src/screens/Profile/Profile.tsx | 9 +- src/screens/Profile/ProfileEdit.tsx | 3 - src/screens/Profile/ProfileLink.tsx | 2 +- src/screens/Profile/ProfileOnboarding.tsx | 10 +- src/screens/Recovery/Mnemonic.tsx | 2 +- src/screens/Recovery/Recovery.tsx | 2 +- src/screens/Scanner/MainScanner.tsx | 3 +- src/screens/Settings/AddressViewer/index.tsx | 13 +- src/screens/Settings/Advanced/index.tsx | 2 +- src/screens/Settings/Backup/ExportToPhone.tsx | 7 +- .../Settings/Backup/ResetAndRestore.tsx | 10 +- src/screens/Settings/Backup/ShowMnemonic.tsx | 2 +- src/screens/Settings/ElectrumConfig/index.tsx | 1 + .../Settings/Lightning/ChannelDetails.tsx | 5 +- src/screens/Settings/Lightning/Channels.tsx | 1 + .../Settings/Lightning/CloseConnection.tsx | 5 +- .../Settings/Lightning/LightningNodeInfo.tsx | 13 +- .../Lightning/OpenConnectionSuccess.tsx | 74 -------- src/screens/Settings/PIN/AskForBiometrics.tsx | 2 +- src/screens/Settings/PIN/ChangePin.tsx | 8 +- src/screens/Settings/PIN/ChangePin2.tsx | 4 - src/screens/Settings/PIN/DisablePin.tsx | 7 +- src/screens/Settings/PIN/ForgotPIN.tsx | 2 +- src/screens/Settings/PIN/PinChanged.tsx | 6 +- src/screens/Settings/PIN/Result.tsx | 2 +- .../Settings/Quickpay/QuickpayIntro.tsx | 3 - .../Settings/Quickpay/QuickpaySettings.tsx | 14 +- src/screens/Settings/RGSServer/index.tsx | 1 + .../Settings/ReportIssue/FormError.tsx | 7 +- .../Settings/ReportIssue/FormSuccess.tsx | 7 +- src/screens/Settings/ReportIssue/index.tsx | 7 +- src/screens/Settings/SettingsView.tsx | 16 +- src/screens/Settings/Tags/index.tsx | 5 +- src/screens/Settings/WebRelay/index.tsx | 1 + src/screens/Transfer/Availability.tsx | 2 +- src/screens/Transfer/ExternalNode/Amount.tsx | 5 +- src/screens/Transfer/ExternalNode/Confirm.tsx | 5 +- .../Transfer/ExternalNode/Connection.tsx | 5 +- .../Transfer/ExternalNode/FeeCustom.tsx | 5 +- src/screens/Transfer/ExternalNode/Success.tsx | 5 +- src/screens/Transfer/Funding.tsx | 9 +- src/screens/Transfer/FundingAdvanced.tsx | 7 +- src/screens/Transfer/Interrupted.tsx | 5 +- src/screens/Transfer/LNURLChannel.tsx | 9 +- src/screens/Transfer/Liquidity.tsx | 5 +- src/screens/Transfer/SavingsAdvanced.tsx | 5 +- src/screens/Transfer/SavingsConfirm.tsx | 5 +- src/screens/Transfer/SavingsIntro.tsx | 5 - src/screens/Transfer/SavingsProgress.tsx | 7 +- src/screens/Transfer/SettingUp.tsx | 5 +- src/screens/Transfer/SpendingAdvanced.tsx | 7 +- src/screens/Transfer/SpendingAmount.tsx | 5 +- src/screens/Transfer/SpendingConfirm.tsx | 5 +- src/screens/Transfer/SpendingIntro.tsx | 3 - src/screens/Transfer/Success.tsx | 5 +- src/screens/Transfer/TransferIntro.tsx | 5 +- src/screens/Wallets/BoostPrompt.tsx | 2 +- src/screens/Wallets/LNURLPay/Confirm.tsx | 2 +- src/screens/Wallets/LNURLWithdraw/Confirm.tsx | 4 +- src/screens/Wallets/NewTxPrompt.tsx | 2 +- src/screens/Wallets/Receive/ReceiveAmount.tsx | 5 +- .../Wallets/Receive/ReceiveDetails.tsx | 2 +- .../Wallets/Receive/ReceiveGeoBlocked.tsx | 5 +- src/screens/Wallets/Receive/ReceiveQR.tsx | 2 +- src/screens/Wallets/Send/Amount.tsx | 2 +- src/screens/Wallets/Send/Contacts.tsx | 4 +- src/screens/Wallets/Send/Pending.tsx | 2 +- src/screens/Wallets/Send/Quickpay.tsx | 2 +- src/screens/Wallets/Send/Recipient.tsx | 2 +- src/screens/Wallets/Send/Success.tsx | 6 +- src/screens/Widgets/Widget.tsx | 9 +- src/screens/Widgets/WidgetEdit.tsx | 5 +- src/screens/Widgets/WidgetsOnboarding.tsx | 3 - src/screens/Widgets/WidgetsSuggestions.tsx | 5 +- src/styles/components.ts | 1 - yarn.lock | 139 +++++++++------ 116 files changed, 613 insertions(+), 803 deletions(-) delete mode 100644 src/screens/Settings/Lightning/OpenConnectionSuccess.tsx diff --git a/e2e/backup.e2e.js b/e2e/backup.e2e.js index abc465047..eb15cfe05 100644 --- a/e2e/backup.e2e.js +++ b/e2e/backup.e2e.js @@ -121,6 +121,7 @@ d('Backup', () => { element(by.id(`Tag-${tag}`).withAncestor(by.id('ActivityTags'))), ).toBeVisible(); await element(by.id('NavigationClose')).atIndex(0).tap(); + await sleep(200); // animation // check widgets await element(by.id('WalletsScrollView')).scroll(300, 'down', NaN, 0.85); diff --git a/e2e/channels.e2e.js b/e2e/channels.e2e.js index a5808f75a..28491c89d 100644 --- a/e2e/channels.e2e.js +++ b/e2e/channels.e2e.js @@ -107,7 +107,7 @@ d('Transfer', () => { let { label } = await element( by.id('SpendingAdvancedNumberField'), ).getAttributes(); - const lspBalance = Number.parseInt(label); + const lspBalance = Number.parseInt(label, 10); jestExpect(lspBalance).toBeGreaterThan(440); jestExpect(lspBalance).toBeLessThan(460); await element(by.id('SpendingAdvancedNumberField')).tap(); diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 598879976..576dae651 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -31,9 +31,9 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - MMKV (1.3.7): - - MMKVCore (~> 1.3.7) - - MMKVCore (1.3.7) + - MMKV (2.0.0): + - MMKVCore (~> 2.0.0) + - MMKVCore (2.0.0) - OpenSSL-Universal (3.3.2000) - RCT-Folly (2024.01.01.00): - boost @@ -1423,7 +1423,7 @@ PODS: - Yoga - react-native-restart (0.0.27): - React-Core - - react-native-safe-area-context (4.10.9): + - react-native-safe-area-context (5.0.0): - React-Core - react-native-skia (1.3.11): - DoubleConversion @@ -1842,7 +1842,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - RNScreens (3.34.0): + - RNScreens (4.3.0): - DoubleConversion - glog - hermes-engine @@ -2216,8 +2216,8 @@ SPEC CHECKSUMS: hermes-engine: 3b6e0717ca847e2fc90a201e59db36caf04dee88 lottie-ios: e047b1d2e6239b787cc5e9755b988869cf190494 lottie-react-native: 31197e5c65aa7cb59e6affcefaf901588bb708c4 - MMKV: 36a22a9ec84c9bb960613a089ddf6f48be9312b0 - MMKVCore: 158e61c8516401a9fac730288acb29e6fc19bbf9 + MMKV: f7d1d5945c8765f97f39c3d121f353d46735d801 + MMKVCore: c04b296010fcb1d1638f2c69405096aac12f6390 OpenSSL-Universal: b60a3702c9fea8b3145549d421fdb018e53ab7b4 RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 RCTDeprecation: 34cbf122b623037ea9facad2e92e53434c5c7422 @@ -2259,7 +2259,7 @@ SPEC CHECKSUMS: react-native-quick-base64: f98f17faf04c9779faf726921a2b389d4775e8b6 react-native-quick-crypto: 12de8e1666ad3dab6339418c14f4a6de71716194 react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162 - react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a + react-native-safe-area-context: ab7beb734b0f9f79f55ae144a6c946a6422f55d6 react-native-skia: 68be40d53b1957f6c276cec19bcd50d293173868 react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7 React-nativeconfig: 57781b79e11d5af7573e6f77cbf1143b71802a6d @@ -2301,7 +2301,7 @@ SPEC CHECKSUMS: RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93 RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9 RNReanimated: 74413c59c47123d7144db601d065627c75c746a3 - RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06 + RNScreens: b03d696c70cc5235ce4587fcc27ae1a93a48f98c RNShare: 554a91f5cfbe4adac4cfe3654826ee8b299fe365 RNSVG: 43b64ed39c14ce830d840903774154ca0c1f27ec RNZipArchive: 7bb4c70d6aa2dd235212c0a4a3de0a4e237e2569 diff --git a/ios/bitkit.xcodeproj/project.pbxproj b/ios/bitkit.xcodeproj/project.pbxproj index 3276567d6..09f6b35be 100644 --- a/ios/bitkit.xcodeproj/project.pbxproj +++ b/ios/bitkit.xcodeproj/project.pbxproj @@ -14,14 +14,14 @@ 17074219BB5847259EAFC7A6 /* InterTight-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3815D562618543E7A9BC191E /* InterTight-Black.ttf */; }; 57072143CA0F49089AE64F61 /* InterTight-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A223BA795CEB4CB2B344FBAF /* InterTight-ExtraBold.ttf */; }; 6980B602E6DC4429841BE5EE /* InterTight-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D67AECF5F543462F90EC89AD /* InterTight-Medium.ttf */; }; - 7B98D2EB65CFC041113931A2 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 653856A32F428EE2C28E3A96 /* libPods-bitkit-bitkitTests.a */; }; + 789827F8833B093D31DFF806 /* libPods-bitkit-bitkitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F403DA8EBCB4E2689002976 /* libPods-bitkit-bitkitTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 8BD8301E3A1B44DDA3C8A10D /* Damion-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = DEC74C5375A34FFCAEBA0781 /* Damion-Regular.ttf */; }; 925570EA7B1D43CC8AD07B91 /* InterTight-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CA37793F82F144678099A00D /* InterTight-Bold.ttf */; }; 9952E811473D46FB9003A56D /* InterTight-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 50A8DA09F2974D05A3C58E87 /* InterTight-SemiBold.ttf */; }; B3BE07A9843E4B7DA375B877 /* InterTight-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 79DFAC55B0D745DE815EC2E0 /* InterTight-Regular.ttf */; }; + DD512D5C0550FBA9B8E2227E /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B949EEE22FEB061C8CBCB427 /* libPods-bitkit.a */; }; E2F35FC226645CE623C61C03 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 919FE2A2B4A7605C9F606896 /* PrivacyInfo.xcprivacy */; }; - F1E150FC6BA3D279F2DFA9DE /* libPods-bitkit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A1E71C62B79795551E15D38 /* libPods-bitkit.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -45,22 +45,22 @@ 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = bitkit/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = bitkit/main.m; sourceTree = ""; }; 13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = bitkit/PrivacyInfo.xcprivacy; sourceTree = ""; }; - 1A1E71C62B79795551E15D38 /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 30A5A1C795205E44CFE0B84E /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; 3815D562618543E7A9BC191E /* InterTight-Black.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Black.ttf"; path = "../src/assets/fonts/InterTight-Black.ttf"; sourceTree = ""; }; - 494310D695EE135B7B1B7996 /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; 50A8DA09F2974D05A3C58E87 /* InterTight-SemiBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-SemiBold.ttf"; path = "../src/assets/fonts/InterTight-SemiBold.ttf"; sourceTree = ""; }; - 653856A32F428EE2C28E3A96 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 79DFAC55B0D745DE815EC2E0 /* InterTight-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Regular.ttf"; path = "../src/assets/fonts/InterTight-Regular.ttf"; sourceTree = ""; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = bitkit/LaunchScreen.storyboard; sourceTree = ""; }; + 8F403DA8EBCB4E2689002976 /* libPods-bitkit-bitkitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit-bitkitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 919FE2A2B4A7605C9F606896 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = bitkit/PrivacyInfo.xcprivacy; sourceTree = ""; }; - 97811DD6E320FC8F3A6F8986 /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; - 9C3FCE6AE94B6C974F28C559 /* Pods-bitkit-bitkitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.debug.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.debug.xcconfig"; sourceTree = ""; }; + 9349F4DDA33D403EE5F67860 /* Pods-bitkit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.debug.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.debug.xcconfig"; sourceTree = ""; }; A223BA795CEB4CB2B344FBAF /* InterTight-ExtraBold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-ExtraBold.ttf"; path = "../src/assets/fonts/InterTight-ExtraBold.ttf"; sourceTree = ""; }; - C4E4FBF74A36838EC0ECDFCA /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; + B949EEE22FEB061C8CBCB427 /* libPods-bitkit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-bitkit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; CA37793F82F144678099A00D /* InterTight-Bold.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Bold.ttf"; path = "../src/assets/fonts/InterTight-Bold.ttf"; sourceTree = ""; }; + CCB8F32E739DCE6C35666E96 /* Pods-bitkit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit.release.xcconfig"; path = "Target Support Files/Pods-bitkit/Pods-bitkit.release.xcconfig"; sourceTree = ""; }; D67AECF5F543462F90EC89AD /* InterTight-Medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "InterTight-Medium.ttf"; path = "../src/assets/fonts/InterTight-Medium.ttf"; sourceTree = ""; }; DEC74C5375A34FFCAEBA0781 /* Damion-Regular.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Damion-Regular.ttf"; path = "../src/assets/fonts/Damion-Regular.ttf"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + FEDDC45B5C30C2E3D09927C7 /* Pods-bitkit-bitkitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-bitkit-bitkitTests.release.xcconfig"; path = "Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -68,7 +68,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7B98D2EB65CFC041113931A2 /* libPods-bitkit-bitkitTests.a in Frameworks */, + 789827F8833B093D31DFF806 /* libPods-bitkit-bitkitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -76,7 +76,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F1E150FC6BA3D279F2DFA9DE /* libPods-bitkit.a in Frameworks */, + DD512D5C0550FBA9B8E2227E /* libPods-bitkit.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -119,8 +119,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 1A1E71C62B79795551E15D38 /* libPods-bitkit.a */, - 653856A32F428EE2C28E3A96 /* libPods-bitkit-bitkitTests.a */, + B949EEE22FEB061C8CBCB427 /* libPods-bitkit.a */, + 8F403DA8EBCB4E2689002976 /* libPods-bitkit-bitkitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -183,10 +183,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 494310D695EE135B7B1B7996 /* Pods-bitkit.debug.xcconfig */, - 97811DD6E320FC8F3A6F8986 /* Pods-bitkit.release.xcconfig */, - 9C3FCE6AE94B6C974F28C559 /* Pods-bitkit-bitkitTests.debug.xcconfig */, - C4E4FBF74A36838EC0ECDFCA /* Pods-bitkit-bitkitTests.release.xcconfig */, + 9349F4DDA33D403EE5F67860 /* Pods-bitkit.debug.xcconfig */, + CCB8F32E739DCE6C35666E96 /* Pods-bitkit.release.xcconfig */, + 30A5A1C795205E44CFE0B84E /* Pods-bitkit-bitkitTests.debug.xcconfig */, + FEDDC45B5C30C2E3D09927C7 /* Pods-bitkit-bitkitTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -198,12 +198,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "bitkitTests" */; buildPhases = ( - AA18EAFFC3FFA647AD9D2C9B /* [CP] Check Pods Manifest.lock */, + 136D8A8120390DDCA7E873DD /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - 92CFC26A8566E781770124E3 /* [CP] Embed Pods Frameworks */, - 478A73F26127205833072041 /* [CP] Copy Pods Resources */, + 5B7437154308FF2AADEBF4A8 /* [CP] Embed Pods Frameworks */, + E65EEF0FBF42B2B3A77B32EB /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -219,13 +219,13 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "bitkit" */; buildPhases = ( - 4CD5B3F172A0F1E4418A21A9 /* [CP] Check Pods Manifest.lock */, + 2DCEAE7D09BBB3F9A35863BF /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 36C8D7231651405035FBA99C /* [CP] Embed Pods Frameworks */, - 706A92543EEBB40418BD08DF /* [CP] Copy Pods Resources */, + 4D3C0F3B99850A226955BC0B /* [CP] Embed Pods Frameworks */, + E7548424844BEE9A03D16B95 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -316,41 +316,29 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 36C8D7231651405035FBA99C /* [CP] Embed Pods Frameworks */ = { + 136D8A8120390DDCA7E873DD /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 478A73F26127205833072041 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-bitkit-bitkitTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 4CD5B3F172A0F1E4418A21A9 /* [CP] Check Pods Manifest.lock */ = { + 2DCEAE7D09BBB3F9A35863BF /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -372,24 +360,24 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 706A92543EEBB40418BD08DF /* [CP] Copy Pods Resources */ = { + 4D3C0F3B99850A226955BC0B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 92CFC26A8566E781770124E3 /* [CP] Embed Pods Frameworks */ = { + 5B7437154308FF2AADEBF4A8 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -406,26 +394,38 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - AA18EAFFC3FFA647AD9D2C9B /* [CP] Check Pods Manifest.lock */ = { + E65EEF0FBF42B2B3A77B32EB /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-bitkit-bitkitTests-checkManifestLockResult.txt", + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit-bitkitTests/Pods-bitkit-bitkitTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E7548424844BEE9A03D16B95 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-bitkit/Pods-bitkit-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -461,7 +461,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9C3FCE6AE94B6C974F28C559 /* Pods-bitkit-bitkitTests.debug.xcconfig */; + baseConfigurationReference = 30A5A1C795205E44CFE0B84E /* Pods-bitkit-bitkitTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -489,7 +489,7 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C4E4FBF74A36838EC0ECDFCA /* Pods-bitkit-bitkitTests.release.xcconfig */; + baseConfigurationReference = FEDDC45B5C30C2E3D09927C7 /* Pods-bitkit-bitkitTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; BUNDLE_LOADER = "$(TEST_HOST)"; @@ -514,7 +514,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 494310D695EE135B7B1B7996 /* Pods-bitkit.debug.xcconfig */; + baseConfigurationReference = 9349F4DDA33D403EE5F67860 /* Pods-bitkit.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconOrange; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; @@ -546,7 +546,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 97811DD6E320FC8F3A6F8986 /* Pods-bitkit.release.xcconfig */; + baseConfigurationReference = CCB8F32E739DCE6C35666E96 /* Pods-bitkit.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIconOrange; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; diff --git a/package.json b/package.json index d37e15423..1099a0c4a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "scripts": { "start": "react-native start", "android": "react-native run-android", - "ios": "react-native run-ios --simulator='iPhone 15'", + "ios": "react-native run-ios --simulator='iPhone 16'", "ios:se": "react-native run-ios --simulator='iPhone SE (3rd generation)'", "test": "jest --forceExit", "test:coverage": "jest --forceExit --coverage=true", @@ -42,8 +42,8 @@ "@react-native-clipboard/clipboard": "1.14.1", "@react-native-community/blur": "4.4.0", "@react-native-community/netinfo": "11.3.1", - "@react-navigation/native": "6.1.18", - "@react-navigation/native-stack": "6.10.1", + "@react-navigation/native": "7.0.14", + "@react-navigation/native-stack": "7.2.0", "@reduxjs/toolkit": "2.2.6", "@shopify/react-native-skia": "1.3.11", "@synonymdev/blocktank-lsp-http-client": "2.2.0", @@ -104,8 +104,8 @@ "react-native-reanimated": "3.15.0", "react-native-reanimated-carousel": "3.5.1", "react-native-restart": "0.0.27", - "react-native-safe-area-context": "4.10.9", - "react-native-screens": "3.34.0", + "react-native-safe-area-context": "5.0.0", + "react-native-screens": "4.3.0", "react-native-share": "10.2.0", "react-native-svg": "15.2.0", "react-native-tcp-socket": "6.0.6", diff --git a/src/components/BottomSheetNavigationHeader.tsx b/src/components/BottomSheetNavigationHeader.tsx index 0b0ca2305..1cf847e2e 100644 --- a/src/components/BottomSheetNavigationHeader.tsx +++ b/src/components/BottomSheetNavigationHeader.tsx @@ -5,10 +5,17 @@ import NavigationHeader, { NavigationHeaderProps, } from '../components/NavigationHeader'; -type Props = Omit & { title: string }; +type Props = Omit & { + title: string; +}; const BottomSheetNavigationHeader = (props: Props): ReactElement => ( - + ); const styles = StyleSheet.create({ diff --git a/src/components/BottomSheetScreen.tsx b/src/components/BottomSheetScreen.tsx index 0b89253c2..248087846 100644 --- a/src/components/BottomSheetScreen.tsx +++ b/src/components/BottomSheetScreen.tsx @@ -19,7 +19,7 @@ const BottomSheetScreen = ({ image, continueText, cancelText, - displayBackButton = true, + showBackButton = true, isLoading, testID, onCancel, @@ -31,7 +31,7 @@ const BottomSheetScreen = ({ image: ImageSourcePropType; continueText: string; cancelText?: string; - displayBackButton?: boolean; + showBackButton?: boolean; isLoading?: boolean; testID?: string; onCancel?: () => void; @@ -50,7 +50,7 @@ const BottomSheetScreen = ({ void; onButtonPress: () => void; }): ReactElement => { return ( @@ -33,8 +33,8 @@ const InfoScreen = ({ {title} diff --git a/src/components/NavigationHeader.tsx b/src/components/NavigationHeader.tsx index f55d01de2..b39240bff 100644 --- a/src/components/NavigationHeader.tsx +++ b/src/components/NavigationHeader.tsx @@ -12,6 +12,7 @@ import { Subtitle, Title } from '../styles/text'; import { BackIcon, XIcon } from '../styles/icons'; import { Keyboard } from '../hooks/keyboard'; import { Pressable } from '../styles/components'; +import { RootNavigationProp } from '../navigation/types'; export const HEADER_HEIGHT = 46; @@ -49,38 +50,55 @@ const ACTION_WIDTH = 45; export type NavigationHeaderProps = { title?: string; icon?: ReactElement; - displayBackButton?: boolean; - navigateBack?: boolean; + showBackButton?: boolean; + showCloseButton?: boolean; actionIcon?: ReactElement; size?: 'lg' | 'sm'; style?: StyleProp; onBackPress?: () => void; - onClosePress?: () => void; onActionPress?: () => void; }; const NavigationHeader = ({ title = ' ', icon, - displayBackButton = true, - navigateBack = true, + showBackButton = true, + showCloseButton = true, size = 'lg', actionIcon, style, onBackPress, - onClosePress, onActionPress, }: NavigationHeaderProps): ReactElement => { - const navigation = useNavigation(); + const navigation = useNavigation(); const handleBackPress = useCallback(async () => { - onBackPress?.(); - if (navigateBack) { - // make sure Keyboard is closed before navigating back to prevent layout bugs - await Keyboard.dismiss(); + // make sure Keyboard is closed before navigating back to prevent layout bugs + await Keyboard.dismiss(); + + if (onBackPress) { + onBackPress(); + } else { navigation.goBack(); } - }, [navigation, navigateBack, onBackPress]); + }, [navigation, onBackPress]); + + const handleClosePress = useCallback(async () => { + const parent = navigation.getParent?.(); + const state = navigation.getState?.(); + const routeNames = state?.routes.map((route) => route.name); + const hasWalletRoute = routeNames?.includes('Wallet'); + + // make sure Keyboard is closed before navigating back to prevent layout bugs + await Keyboard.dismiss(); + + if (hasWalletRoute || parent) { + // for nested navigators, pop to top of parent navigator + navigation.popTo('Wallet', { screen: 'Wallets' }); + } else { + navigation.popToTop(); + } + }, [navigation]); const Text = useMemo(() => (size === 'lg' ? Title : Subtitle), [size]); const container = useMemo( @@ -92,18 +110,20 @@ const NavigationHeader = ({ [size, style], ); - // TODO: this doesn't have the right navigator - const showBack = Boolean(displayBackButton && navigation.canGoBack()); + const state = navigation.getState?.(); + const parent = navigation.getParent?.(); + const canGoBack = state?.routes.length > 1 || parent; + const showBack = showBackButton && canGoBack; const numberOfActions = useMemo(() => { - if (actionIcon && onClosePress) { + if (actionIcon && showCloseButton) { return 2; - } else if (showBack || actionIcon || onClosePress) { + } else if (showBack || actionIcon || showCloseButton) { return 1; } else { return 0; } - }, [actionIcon, onClosePress, showBack]); + }, [actionIcon, showBack, showCloseButton]); const actionColumn = useMemo( () => [ @@ -146,11 +166,11 @@ const NavigationHeader = ({ {actionIcon} )} - {onClosePress && ( + {showCloseButton && ( + onPress={handleClosePress}> )} diff --git a/src/components/OnboardingScreen.tsx b/src/components/OnboardingScreen.tsx index f016493a8..ee60b8d2f 100644 --- a/src/components/OnboardingScreen.tsx +++ b/src/components/OnboardingScreen.tsx @@ -14,11 +14,11 @@ const OnboardingScreen = ({ image, imagePosition, buttonText, - displayBackButton = true, + showBackButton = true, + showCloseButton = true, disableNav = false, mirrorImage = false, testID, - onClosePress, onButtonPress, }: { navTitle?: string; @@ -27,11 +27,11 @@ const OnboardingScreen = ({ image: ImageSourcePropType; imagePosition?: 'center' | 'bottom'; buttonText: string; - displayBackButton?: boolean; + showBackButton?: boolean; + showCloseButton?: boolean; disableNav?: boolean; mirrorImage?: boolean; testID?: string; - onClosePress?: () => void; onButtonPress: () => void; }): ReactElement => { return ( @@ -42,8 +42,8 @@ const OnboardingScreen = ({ ) : ( )} diff --git a/src/components/PinPad.tsx b/src/components/PinPad.tsx index aa2c9b6b7..8278139fe 100644 --- a/src/components/PinPad.tsx +++ b/src/components/PinPad.tsx @@ -54,7 +54,10 @@ const PinPad = ({ - + diff --git a/src/navigation/bottom-sheet/BackupNavigation.tsx b/src/navigation/bottom-sheet/BackupNavigation.tsx index 19d960288..a83ebdead 100644 --- a/src/navigation/bottom-sheet/BackupNavigation.tsx +++ b/src/navigation/bottom-sheet/BackupNavigation.tsx @@ -1,11 +1,12 @@ import React, { ReactElement, memo } from 'react'; -import { useAppSelector } from '../../hooks/redux'; +import { NavigationIndependentTree } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackNavigationOptions, NativeStackNavigationProp, } from '@react-navigation/native-stack'; +import { NavigationContainer } from '../../styles/components'; import BottomSheetWrapper from '../../components/BottomSheetWrapper'; import ShowMnemonic from '../../screens/Settings/Backup/ShowMnemonic'; import ShowPassphrase from '../../screens/Settings/Backup/ShowPassphrase'; @@ -15,8 +16,8 @@ import Success from '../../screens/Settings/Backup/Success'; import Warning from '../../screens/Settings/Backup/Warning'; import MultipleDevices from '../../screens/Settings/Backup/MultipleDevices'; import Metadata from '../../screens/Settings/Backup/Metadata'; -import { NavigationContainer } from '../../styles/components'; import { useSnapPoints } from '../../hooks/bottomSheet'; +import { useAppSelector } from '../../hooks/redux'; import { viewControllerIsOpenSelector } from '../../store/reselect/ui'; import { __E2E__ } from '../../constants/env'; @@ -49,9 +50,9 @@ const BackupNavigation = (): ReactElement => { return ( - - - + + + @@ -63,9 +64,9 @@ const BackupNavigation = (): ReactElement => { - - - + + + ); }; diff --git a/src/navigation/bottom-sheet/ConnectionClosed.tsx b/src/navigation/bottom-sheet/ConnectionClosed.tsx index 9d5f592d4..a268c81e6 100644 --- a/src/navigation/bottom-sheet/ConnectionClosed.tsx +++ b/src/navigation/bottom-sheet/ConnectionClosed.tsx @@ -30,10 +30,7 @@ const ConnectionClosed = (): ReactElement => { return ( - + {t('connection_closed.description')} diff --git a/src/navigation/bottom-sheet/LNURLWithdrawNavigation.tsx b/src/navigation/bottom-sheet/LNURLWithdrawNavigation.tsx index 1e96974f6..a4c766385 100644 --- a/src/navigation/bottom-sheet/LNURLWithdrawNavigation.tsx +++ b/src/navigation/bottom-sheet/LNURLWithdrawNavigation.tsx @@ -1,19 +1,20 @@ import React, { ReactElement, memo } from 'react'; -import { useAppSelector } from '../../hooks/redux'; +import { LNURLWithdrawParams } from 'js-lnurl'; +import { NavigationIndependentTree } from '@react-navigation/native'; import { NativeStackNavigationOptions, NativeStackNavigationProp, createNativeStackNavigator, } from '@react-navigation/native-stack'; -import { LNURLWithdrawParams } from 'js-lnurl'; +import { NavigationContainer } from '../../styles/components'; import BottomSheetWrapper from '../../components/BottomSheetWrapper'; -import { __E2E__ } from '../../constants/env'; -import { useSnapPoints } from '../../hooks/bottomSheet'; import Amount from '../../screens/Wallets/LNURLWithdraw/Amount'; import Confirm from '../../screens/Wallets/LNURLWithdraw/Confirm'; +import { useSnapPoints } from '../../hooks/bottomSheet'; +import { useAppSelector } from '../../hooks/redux'; import { viewControllerSelector } from '../../store/reselect/ui'; -import { NavigationContainer } from '../../styles/components'; +import { __E2E__ } from '../../constants/env'; export type LNURLWithdrawNavigationProp = NativeStackNavigationProp; @@ -46,22 +47,24 @@ const LNURLWithdrawNavigation = (): ReactElement => { return ( - - - - - - + + + + + + + + ); }; diff --git a/src/navigation/bottom-sheet/OrangeTicketNavigation.tsx b/src/navigation/bottom-sheet/OrangeTicketNavigation.tsx index 1ff2defbe..b6e306abc 100644 --- a/src/navigation/bottom-sheet/OrangeTicketNavigation.tsx +++ b/src/navigation/bottom-sheet/OrangeTicketNavigation.tsx @@ -6,6 +6,7 @@ import React, { useState, } from 'react'; import { ldk } from '@synonymdev/react-native-ldk'; +import { NavigationIndependentTree } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackNavigationProp, @@ -157,27 +158,29 @@ const OrangeTicket = (): ReactElement => { return ( - - - - - - - + + + + + + + + + ); }; diff --git a/src/navigation/bottom-sheet/PINNavigation.tsx b/src/navigation/bottom-sheet/PINNavigation.tsx index b8763f4b6..8a6bb8e69 100644 --- a/src/navigation/bottom-sheet/PINNavigation.tsx +++ b/src/navigation/bottom-sheet/PINNavigation.tsx @@ -1,6 +1,7 @@ import React, { ReactElement, memo } from 'react'; import { useAppSelector } from '../../hooks/redux'; import { BiometryType } from 'react-native-biometrics'; +import { NavigationIndependentTree } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackNavigationOptions, @@ -41,14 +42,19 @@ const PINNavigation = (): ReactElement => { return ( - - - - - - - - + + + + + + + + + + ); }; diff --git a/src/navigation/bottom-sheet/ProfileLinkNavigation.tsx b/src/navigation/bottom-sheet/ProfileLinkNavigation.tsx index 108b16d64..8af1946b5 100644 --- a/src/navigation/bottom-sheet/ProfileLinkNavigation.tsx +++ b/src/navigation/bottom-sheet/ProfileLinkNavigation.tsx @@ -1,18 +1,19 @@ import React, { ReactElement, memo } from 'react'; -import { useAppSelector } from '../../hooks/redux'; +import { NavigationIndependentTree } from '@react-navigation/native'; import { NativeStackNavigationOptions, NativeStackNavigationProp, createNativeStackNavigator, } from '@react-navigation/native-stack'; +import { NavigationContainer } from '../../styles/components'; import BottomSheetWrapper from '../../components/BottomSheetWrapper'; -import { __E2E__ } from '../../constants/env'; -import { useSnapPoints } from '../../hooks/bottomSheet'; import ProfileLink from '../../screens/Profile/ProfileLink'; import ProfileLinkSuggestions from '../../screens/Profile/ProfileLinkSuggestions'; +import { useAppSelector } from '../../hooks/redux'; +import { useSnapPoints } from '../../hooks/bottomSheet'; import { viewControllerIsOpenSelector } from '../../store/reselect/ui'; -import { NavigationContainer } from '../../styles/components'; +import { __E2E__ } from '../../constants/env'; export type ProfileLinkNavigationProp = NativeStackNavigationProp; @@ -37,15 +38,17 @@ const ProfileLinkNavigation = (): ReactElement => { return ( - - - - - - + + + + + + + + ); }; diff --git a/src/navigation/bottom-sheet/PubkyAuth.tsx b/src/navigation/bottom-sheet/PubkyAuth.tsx index 8fd3bc304..eb00b99cb 100644 --- a/src/navigation/bottom-sheet/PubkyAuth.tsx +++ b/src/navigation/bottom-sheet/PubkyAuth.tsx @@ -1,4 +1,10 @@ -import React, { memo, ReactElement, useCallback, useEffect, useMemo } from 'react'; +import React, { + memo, + ReactElement, + useCallback, + useEffect, + useMemo, +} from 'react'; import { StyleSheet, View } from 'react-native'; import { useTranslation } from 'react-i18next'; @@ -8,9 +14,7 @@ import SafeAreaInset from '../../components/SafeAreaInset'; import Button from '../../components/buttons/Button'; import BottomSheetNavigationHeader from '../../components/BottomSheetNavigationHeader'; import { useAppSelector } from '../../hooks/redux'; -import { - useSnapPoints, -} from '../../hooks/bottomSheet'; +import { useSnapPoints } from '../../hooks/bottomSheet'; import { viewControllerSelector } from '../../store/reselect/ui.ts'; import { auth, parseAuthUrl } from '@synonymdev/react-native-pubky'; import { getPubkySecretKey } from '../../utils/pubky'; @@ -22,10 +26,12 @@ import Animated, { FadeIn } from 'react-native-reanimated'; const defaultParsedUrl: PubkyAuthDetails = { relay: '', - capabilities: [{ - path: '', - permission: '', - }], + capabilities: [ + { + path: '', + permission: '', + }, + ], secret: '', }; @@ -40,28 +46,37 @@ type PubkyAuthDetails = { secret: string; }; -const Permission = memo(({ capability, authSuccess }: { capability: Capability; authSuccess: boolean }): ReactElement => { - return ( - - - {capability.path} - - - - {capability.permission.includes('r') && ( - Read - - )} +const Permission = memo( + ({ + capability, + authSuccess, + }: { + capability: Capability; + authSuccess: boolean; + }): ReactElement => { + return ( + + + + {capability.path} + - - {capability.permission.includes('w') && ( - Write - )} + + + {capability.permission.includes('r') && ( + Read + )} + + + {capability.permission.includes('w') && ( + Write + )} + - - ); -}); + ); + }, +); const PubkyAuth = (): ReactElement => { const { t } = useTranslation('security'); @@ -69,7 +84,8 @@ const PubkyAuth = (): ReactElement => { const { url = '' } = useAppSelector((state) => { return viewControllerSelector(state, 'pubkyAuth'); }); - const [parsed, setParsed] = React.useState(defaultParsedUrl); + const [parsed, setParsed] = + React.useState(defaultParsedUrl); const [authorizing, setAuthorizing] = React.useState(false); const [authSuccess, setAuthSuccess] = React.useState(false); @@ -91,44 +107,50 @@ const PubkyAuth = (): ReactElement => { }; }, [url]); - const onAuthorize = useMemo(() => async (): Promise => { - try { - setAuthorizing(true); - const secretKey = await getPubkySecretKey(); - if (secretKey.isErr()) { - showToast({ - type: 'error', - title: t('authorization.pubky_secret_error_title'), - description: t('authorization.pubky_secret_error_description'), - }); + const onAuthorize = useMemo( + () => async (): Promise => { + try { + setAuthorizing(true); + const secretKey = await getPubkySecretKey(); + if (secretKey.isErr()) { + showToast({ + type: 'error', + title: t('authorization.pubky_secret_error_title'), + description: t('authorization.pubky_secret_error_description'), + }); + setAuthorizing(false); + return; + } + const authRes = await auth(url, secretKey.value); + if (authRes.isErr()) { + showToast({ + type: 'error', + title: t('authorization.pubky_auth_error_title'), + description: t('authorization.pubky_auth_error_description'), + }); + setAuthorizing(false); + return; + } + setAuthSuccess(true); setAuthorizing(false); - return; - } - const authRes = await auth(url, secretKey.value); - if (authRes.isErr()) { + } catch (e) { showToast({ type: 'error', title: t('authorization.pubky_auth_error_title'), - description: t('authorization.pubky_auth_error_description'), + description: JSON.stringify(e), }); setAuthorizing(false); - return; } - setAuthSuccess(true); - setAuthorizing(false); - } catch (e) { - showToast({ - type: 'error', - title: t('authorization.pubky_auth_error_title'), - description: JSON.stringify(e), - }); - setAuthorizing(false); - } - }, [t, url]); + }, + [t, url], + ); - const onClose = useMemo(() => (): void => { - dispatch(closeSheet('pubkyAuth')); - }, []); + const onClose = useMemo( + () => (): void => { + dispatch(closeSheet('pubkyAuth')); + }, + [], + ); const Buttons = useCallback(() => { if (authSuccess) { @@ -152,7 +174,11 @@ const PubkyAuth = (): ReactElement => {