diff --git a/App.tsx b/App.tsx index 0772aed08..9bc7804b3 100644 --- a/App.tsx +++ b/App.tsx @@ -1,6 +1,6 @@ import 'react-native-gesture-handler'; // should be on top -import React, { useEffect } from 'react'; -import { NativeModules, Platform, useColorScheme } from 'react-native'; +import React from 'react'; +import { useColorScheme } from 'react-native'; import { NavigationContainer } from '@react-navigation/native'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import { navigationRef } from './NavigationService'; @@ -9,30 +9,25 @@ import { NavigationProvider } from './components/NavigationProvider'; import { BlueStorageProvider } from './blue_modules/storage-context'; import MasterView from './MasterView'; import { SettingsProvider } from './components/Context/SettingsContext'; -const { SplashScreen } = NativeModules; +import { LargeScreenProvider } from './components/Context/LargeScreenProvider'; const App = () => { const colorScheme = useColorScheme(); - useEffect(() => { - if (Platform.OS === 'ios') { - // Call hide to setup the listener on the native side - SplashScreen?.addObserver(); - } - }, []); - return ( - - - - - - - - - - - + + + + + + + + + + + + + ); }; diff --git a/MasterView.tsx b/MasterView.tsx index f12468d37..7bef9f3c9 100644 --- a/MasterView.tsx +++ b/MasterView.tsx @@ -1,22 +1,13 @@ import 'react-native-gesture-handler'; // should be on top -import React, { Suspense, lazy, useEffect } from 'react'; -import { NativeModules, Platform } from 'react-native'; +import React, { Suspense, lazy } from 'react'; import MainRoot from './navigation'; import { useStorage } from './blue_modules/storage-context'; import Biometric from './class/biometrics'; const CompanionDelegates = lazy(() => import('./components/CompanionDelegates')); -const { SplashScreen } = NativeModules; const MasterView = () => { const { walletsInitialized } = useStorage(); - useEffect(() => { - if (Platform.OS === 'ios') { - // Call hide to setup the listener on the native side - SplashScreen?.addObserver(); - } - }, []); - return ( <> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 385824b24..7376d7788 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,50 +7,52 @@ android:required="false" /> - - - + + + - + + android:name=".MainApplication" + android:label="@string/app_name" + android:icon="@mipmap/ic_launcher" + android:roundIcon="@mipmap/ic_launcher_round" + android:allowBackup="false" + android:largeHeap="true" + android:extractNativeLibs="true" + android:usesCleartextTraffic="true" + android:supportsRtl="true" + android:theme="@style/AppTheme" + android:networkSecurityConfig="@xml/network_security_config"> - - - - - - - - - + + + + + - @@ -58,71 +60,65 @@ + android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" + android:exported="false"> - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + diff --git a/android/app/src/main/java/io/bluewallet/bluewallet/SplashActivity.java b/android/app/src/main/java/io/bluewallet/bluewallet/SplashActivity.java deleted file mode 100644 index 161055463..000000000 --- a/android/app/src/main/java/io/bluewallet/bluewallet/SplashActivity.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.bluewallet.bluewallet; // Replace with your package name - -import android.content.Intent; -import android.os.Bundle; -import android.os.Handler; -import androidx.appcompat.app.AppCompatActivity; - -public class SplashActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.splash_screen); // Replace with your layout name - - int SPLASH_DISPLAY_LENGTH = 1000; // Splash screen duration in milliseconds - - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - Intent mainIntent = new Intent(SplashActivity.this, MainActivity.class); - SplashActivity.this.startActivity(mainIntent); - SplashActivity.this.finish(); - } - }, SPLASH_DISPLAY_LENGTH); - } -} diff --git a/android/app/src/main/res/layout/splash_screen.xml b/android/app/src/main/res/layout/splash_screen.xml deleted file mode 100644 index c90f097b0..000000000 --- a/android/app/src/main/res/layout/splash_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/blue_modules/environment.ts b/blue_modules/environment.ts index c6e5db789..987f92c9b 100644 --- a/blue_modules/environment.ts +++ b/blue_modules/environment.ts @@ -1,6 +1,7 @@ -import { isTablet, getDeviceType } from 'react-native-device-info'; +import { isTablet as checkIsTablet, getDeviceType } from 'react-native-device-info'; +const isTablet: boolean = checkIsTablet(); const isDesktop: boolean = getDeviceType() === 'Desktop'; +const isHandset: boolean = getDeviceType() === 'Handset'; -export const isHandset: boolean = getDeviceType() === 'Handset'; -export { isDesktop, isTablet }; +export { isDesktop, isTablet, isHandset }; diff --git a/blue_modules/storage-context.tsx b/blue_modules/storage-context.tsx index 6f79b3183..835b3512a 100644 --- a/blue_modules/storage-context.tsx +++ b/blue_modules/storage-context.tsx @@ -74,11 +74,13 @@ export const BlueStorageProvider = ({ children }: { children: React.ReactNode }) useEffect(() => { setWallets(BlueApp.getWallets()); - - BlueElectrum.isDisabled().then(setIsElectrumDisabled); - if (walletsInitialized) { - BlueElectrum.connectMain(); - } + (async () => { + const isElectrumDisabledValue = await BlueElectrum.isDisabled(); + setIsElectrumDisabled(isElectrumDisabledValue); + if (walletsInitialized && !isElectrumDisabledValue) { + BlueElectrum.connectMain(); + } + })(); }, [walletsInitialized]); const saveToDisk = async (force: boolean = false) => { diff --git a/components/Context/LargeScreenProvider.tsx b/components/Context/LargeScreenProvider.tsx new file mode 100644 index 000000000..f39fef626 --- /dev/null +++ b/components/Context/LargeScreenProvider.tsx @@ -0,0 +1,41 @@ +import React, { createContext, useState, useEffect, useMemo, ReactNode } from 'react'; +import { Dimensions } from 'react-native'; +import { isDesktop, isTablet } from '../../blue_modules/environment'; + +interface ILargeScreenContext { + isLargeScreen: boolean; +} + +export const LargeScreenContext = createContext(undefined); + +interface LargeScreenProviderProps { + children: ReactNode; +} + +export const LargeScreenProvider: React.FC = ({ children }) => { + const [windowWidth, setWindowWidth] = useState(Dimensions.get('window').width); + const screenWidth: number = useMemo(() => Dimensions.get('screen').width, []); + + useEffect(() => { + const updateScreenUsage = (): void => { + const newWindowWidth = Dimensions.get('window').width; + if (newWindowWidth !== windowWidth) { + setWindowWidth(newWindowWidth); + } + }; + + const subscription = Dimensions.addEventListener('change', updateScreenUsage); + return () => subscription.remove(); + }, [windowWidth]); + + const isLargeScreen: boolean = useMemo(() => { + const halfScreenWidth = windowWidth >= screenWidth / 2; + const condition = (isTablet && halfScreenWidth) || isDesktop; + console.debug( + `LargeScreenProvider.isLargeScreen: width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTablet}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`, + ); + return condition; + }, [windowWidth, screenWidth]); + + return {children}; +}; diff --git a/components/WalletsCarousel.js b/components/WalletsCarousel.js index 8bf1f9159..4c7c716cd 100644 --- a/components/WalletsCarousel.js +++ b/components/WalletsCarousel.js @@ -154,7 +154,7 @@ const iStyles = StyleSheet.create({ }, }); -export const WalletCarouselItem = ({ item, _, onPress, handleLongPress, isSelectedWallet, customStyle }) => { +export const WalletCarouselItem = React.memo(({ item, _, onPress, handleLongPress, isSelectedWallet, customStyle }) => { const scaleValue = new Animated.Value(1.0); const { colors } = useTheme(); const { walletTransactionUpdateStatus } = useContext(BlueStorageContext); @@ -251,7 +251,7 @@ export const WalletCarouselItem = ({ item, _, onPress, handleLongPress, isSelect ); -}; +}); WalletCarouselItem.propTypes = { item: PropTypes.any, @@ -292,7 +292,7 @@ const WalletsCarousel = forwardRef((props, ref) => { ), // eslint-disable-next-line react-hooks/exhaustive-deps - [horizontal, selectedWallet, handleLongPress, onPress, preferredFiatCurrency, language], + [horizontal, selectedWallet, preferredFiatCurrency, language], ); const flatListRef = useRef(); diff --git a/hooks/useIsLargeScreen.ts b/hooks/useIsLargeScreen.ts index 8c706cade..14ec0cd2d 100644 --- a/hooks/useIsLargeScreen.ts +++ b/hooks/useIsLargeScreen.ts @@ -1,41 +1,10 @@ -import { useState, useEffect, useMemo } from 'react'; -import { Dimensions } from 'react-native'; -import { isTablet } from 'react-native-device-info'; -import { isDesktop } from '../blue_modules/environment'; +import { useContext } from 'react'; +import { LargeScreenContext } from '../components/Context/LargeScreenProvider'; -// Custom hook to determine if the screen is large -export const useIsLargeScreen = () => { - const [windowWidth, setWindowWidth] = useState(Dimensions.get('window').width); - const screenWidth = useMemo(() => Dimensions.get('screen').width, []); - - useEffect(() => { - const updateScreenUsage = () => { - const newWindowWidth = Dimensions.get('window').width; - if (newWindowWidth !== windowWidth) { - console.debug(`Window width changed: ${newWindowWidth}`); - setWindowWidth(newWindowWidth); - } - }; - - // Add event listener for dimension changes - const subscription = Dimensions.addEventListener('change', updateScreenUsage); - - // Cleanup function to remove the event listener - return () => { - subscription.remove(); - }; - }, [windowWidth]); - - // Determine if the window width is at least half of the screen width - const isLargeScreen = useMemo(() => { - const isRunningOnTablet = isTablet(); - const halfScreenWidth = windowWidth >= screenWidth / 2; - const condition = (isRunningOnTablet && halfScreenWidth) || isDesktop; - console.debug( - `Window width: ${windowWidth}, Screen width: ${screenWidth}, Is tablet: ${isTablet()}, Is large screen: ${condition}, isDesktkop: ${isDesktop}`, - ); - return condition; - }, [windowWidth, screenWidth]); - - return isLargeScreen; +export const useIsLargeScreen = (): boolean => { + const context = useContext(LargeScreenContext); + if (context === undefined) { + throw new Error('useIsLargeScreen must be used within a LargeScreenProvider'); + } + return context.isLargeScreen; }; diff --git a/ios/BlueWallet.xcodeproj/project.pbxproj b/ios/BlueWallet.xcodeproj/project.pbxproj index 402662366..4b3804093 100644 --- a/ios/BlueWallet.xcodeproj/project.pbxproj +++ b/ios/BlueWallet.xcodeproj/project.pbxproj @@ -151,8 +151,6 @@ B4A29A3A2B55C990002A67DF /* BlueWalletWatch.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = B40D4E30225841EC00428FCC /* BlueWalletWatch.app */; platformFilter = ios; }; B4A29A3C2B55C990002A67DF /* Stickers.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6D2A6461258BA92C0092292B /* Stickers.appex */; platformFilter = ios; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; B4A29A3D2B55C990002A67DF /* WidgetsExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6DD4109C266CADF10087DE03 /* WidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; - B4AB21072B61D8CA0080440C /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB21062B61D8CA0080440C /* SplashScreen.swift */; }; - B4AB21092B61DC3F0080440C /* SplashScreen.m in Sources */ = {isa = PBXBuildFile; fileRef = B4AB21082B61DC3F0080440C /* SplashScreen.m */; }; B4AB225D2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; }; B4AB225E2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; }; B4EE583C226703320003363C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B40D4E35225841ED00428FCC /* Assets.xcassets */; }; @@ -445,8 +443,6 @@ B49038D82B8FBAD300A8164A /* BlueWalletUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlueWalletUITest.swift; sourceTree = ""; }; B4A29A452B55C990002A67DF /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; }; B4A29A462B55C990002A67DF /* BlueWallet-NoLDK.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlueWallet-NoLDK.plist"; sourceTree = ""; }; - B4AB21062B61D8CA0080440C /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = ""; }; - B4AB21082B61DC3F0080440C /* SplashScreen.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SplashScreen.m; sourceTree = ""; }; B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XMLParserDelegate.swift; sourceTree = ""; }; B4D3235A177F4580BA52F2F9 /* libRNCSlider.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCSlider.a; sourceTree = ""; }; B642AFB13483418CAB6FF25E /* libRCTQRCodeLocalImage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTQRCodeLocalImage.a; sourceTree = ""; }; @@ -865,8 +861,6 @@ B4AB21052B61D8890080440C /* SplashScreen */ = { isa = PBXGroup; children = ( - B4AB21062B61D8CA0080440C /* SplashScreen.swift */, - B4AB21082B61DC3F0080440C /* SplashScreen.m */, ); name = SplashScreen; sourceTree = ""; @@ -1502,9 +1496,7 @@ files = ( B44033E92BCC371A00162242 /* MarketData.swift in Sources */, B44033CA2BCC350A00162242 /* Currency.swift in Sources */, - B4AB21092B61DC3F0080440C /* SplashScreen.m in Sources */, B44033EE2BCC374500162242 /* Numeric+abbreviated.swift in Sources */, - B4AB21072B61D8CA0080440C /* SplashScreen.swift in Sources */, B44033DD2BCC36C300162242 /* LatestTransaction.swift in Sources */, 6D32C5C62596CE3A008C077C /* EventEmitter.m in Sources */, B44033FE2BCC37D700162242 /* MarketAPI.swift in Sources */, diff --git a/ios/BlueWallet/AppDelegate.mm b/ios/BlueWallet/AppDelegate.mm index 0785bc770..c7c6eb307 100644 --- a/ios/BlueWallet/AppDelegate.mm +++ b/ios/BlueWallet/AppDelegate.mm @@ -41,8 +41,6 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu [NSUserDefaults.standardUserDefaults setValue:@"" forKey:@"deviceUIDCopy"]; } - [self addSplashScreenView]; - self.moduleName = @"BlueWallet"; // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. @@ -56,22 +54,6 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu return [super application:application didFinishLaunchingWithOptions:launchOptions]; } -- (void)addSplashScreenView -{ - // Get the rootView - RCTRootView *rootView = (RCTRootView *)self.window.rootViewController.view; - - // Capture the launch screen view - UIStoryboard *launchScreenStoryboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil]; - UIViewController *launchScreenVC = [launchScreenStoryboard instantiateInitialViewController]; - UIView *launchScreenView = launchScreenVC.view; - launchScreenView.frame = self.window.bounds; - [self.window addSubview:launchScreenView]; - - // Keep a reference to the launch screen view to remove it later - rootView.loadingView = launchScreenView; -} - - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG diff --git a/ios/Podfile.lock b/ios/Podfile.lock index f5e9994ad..5aea7401e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,6 +1,6 @@ PODS: - boost (1.76.0) - - BugsnagReactNative (7.22.7): + - BugsnagReactNative (7.23.0): - React-Core - BVLinearGradient (2.8.3): - React-Core @@ -466,7 +466,7 @@ PODS: - React-perflogger (= 0.72.14) - ReactNativeCameraKit (13.0.0): - React-Core - - RealmJS (12.8.0): + - RealmJS (12.8.1): - React - rn-ldk (0.8.4): - React-Core @@ -478,7 +478,7 @@ PODS: - React-Core - RNDefaultPreference (1.4.4): - React-Core - - RNDeviceInfo (10.13.2): + - RNDeviceInfo (10.14.0): - React-Core - RNFS (2.20.0): - React-Core @@ -511,7 +511,7 @@ PODS: - React-RCTImage - RNShare (10.2.0): - React-Core - - RNSVG (13.14.0): + - RNSVG (13.14.1): - React-Core - RNVectorIcons (10.1.0): - RCT-Folly (= 2021.07.22.00) @@ -777,7 +777,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: 7dcd2de282d72e344012f7d6564d024930a6a440 - BugsnagReactNative: 7cc5c927f6a0b00a8e3cc7157dab4cc94a4bc575 + BugsnagReactNative: 079e8ede687b76bd8b661acd55bc5c888af56dc7 BVLinearGradient: 880f91a7854faff2df62518f0281afb1c60d49a3 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 @@ -836,13 +836,13 @@ SPEC CHECKSUMS: React-utils: 22a77b05da25ce49c744faa82e73856dcae1734e ReactCommon: ff94462e007c568d8cdebc32e3c97af86ec93bb5 ReactNativeCameraKit: 9d46a5d7dd544ca64aa9c03c150d2348faf437eb - RealmJS: 3e6010ae878227830e947f40f996e13ccab4c8ba + RealmJS: 2c7fdb3991d7655fba5f88eb288f75eaf5cb9980 rn-ldk: 0d8749d98cc5ce67302a32831818c116b67f7643 RNCAsyncStorage: 826b603ae9c0f88b5ac4e956801f755109fa4d5c RNCClipboard: 0a720adef5ec193aa0e3de24c3977222c7e52a37 RNCPushNotificationIOS: 64218f3c776c03d7408284a819b2abfda1834bc8 RNDefaultPreference: 08bdb06cfa9188d5da97d4642dac745218d7fb31 - RNDeviceInfo: 42aadf1282ffa0a88dc38a504a7be145eb010dfa + RNDeviceInfo: 59344c19152c4b2b32283005f9737c5c64b42fba RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 982741f345785f2927e7b28f67dc83679cf3bfc8 RNHandoff: d3b0754cca3a6bcd9b25f544f733f7f033ccf5fa @@ -856,7 +856,7 @@ SPEC CHECKSUMS: RNReanimated: d4f25b2a931c4f0b2bb12173a3096f02ea4cfb05 RNScreens: b8d370282cdeae9df85dd5eab20c88eb5181243b RNShare: 554a91f5cfbe4adac4cfe3654826ee8b299fe365 - RNSVG: d00c8f91c3cbf6d476451313a18f04d220d4f396 + RNSVG: af3907ac5d4fa26a862b75a16d8f15bc74f2ceda RNVectorIcons: 32462e7c7e58fe457474fc79c4d7de3f0ef08d70 RNWatch: fd30ca40a5b5ef58dcbc195638e68219bc455236 SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 diff --git a/ios/SplashScreen.m b/ios/SplashScreen.m deleted file mode 100644 index 091048ffc..000000000 --- a/ios/SplashScreen.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// SplashScreen.m -// BlueWallet -// -// Created by Marcos Rodriguez on 1/24/24. -// Copyright © 2024 BlueWallet. All rights reserved. -// - -#import - -@interface RCT_EXTERN_MODULE(SplashScreen, NSObject) -RCT_EXTERN_METHOD(addObserver) -RCT_EXTERN_METHOD(dismissSplashScreen) -@end diff --git a/ios/SplashScreen.swift b/ios/SplashScreen.swift deleted file mode 100644 index 6f70d3ca7..000000000 --- a/ios/SplashScreen.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// SplashScreen.swift -// BlueWallet -// -// Created by Marcos Rodriguez on 1/24/24. -// Copyright © 2024 BlueWallet. All rights reserved. -// - -import Foundation -import React - -@objc(SplashScreen) -class SplashScreen: NSObject, RCTBridgeModule { - static func moduleName() -> String! { - return "SplashScreen" - } - - static func requiresMainQueueSetup() -> Bool { - return true - } - - @objc - func addObserver() { - NotificationCenter.default.addObserver(self, selector: #selector(dismissSplashScreen), name: NSNotification.Name("HideSplashScreen"), object: nil) - } - - @objc - func dismissSplashScreen() { - DispatchQueue.main.async { - if let rootView = UIApplication.shared.delegate?.window??.rootViewController?.view as? RCTRootView { - rootView.loadingView?.removeFromSuperview() - rootView.loadingView = nil - } - NotificationCenter.default.removeObserver(self, name: NSNotification.Name("HideSplashScreen"), object: nil) - } - } - - -} diff --git a/navigation/LazyLoadReorderWalletsStack.tsx b/navigation/LazyLoadReorderWalletsStack.tsx deleted file mode 100644 index 39f985456..000000000 --- a/navigation/LazyLoadReorderWalletsStack.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React, { lazy, Suspense } from 'react'; -import { LazyLoadingIndicator } from './LazyLoadingIndicator'; - -const ReorderWallets = lazy(() => import('../screen/wallets/reorderWallets')); - -export const ReorderWalletsComponent = () => ( - }> - - -); diff --git a/navigation/ReorderWalletsStack.tsx b/navigation/ReorderWalletsStack.tsx index defbd53cb..076f4b363 100644 --- a/navigation/ReorderWalletsStack.tsx +++ b/navigation/ReorderWalletsStack.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { ReorderWalletsComponent } from './LazyLoadReorderWalletsStack'; import { useTheme } from '../components/themes'; import navigationStyle from '../components/navigationStyle'; import loc from '../loc'; +import ReorderWallets from '../screen/wallets/reorderWallets'; const Stack = createNativeStackNavigator(); @@ -14,7 +14,7 @@ const ReorderWalletsStackRoot = () => { { const [state, dispatch] = useReducer(reducer, initialState); const isUnlockingWallets = useRef(false); @@ -91,8 +89,6 @@ const UnlockWith: React.FC = () => { }, [state.isAuthenticating, startAndDecrypt, successfullyAuthenticated]); useEffect(() => { - SplashScreen?.dismissSplashScreen(); - const startUnlock = async () => { const storageIsEncrypted = await isStorageEncrypted(); const isBiometricUseCapableAndEnabled = await Biometric.isBiometricUseCapableAndEnabled(); diff --git a/screen/send/Broadcast.tsx b/screen/send/Broadcast.tsx index 33d5358f0..83be8c227 100644 --- a/screen/send/Broadcast.tsx +++ b/screen/send/Broadcast.tsx @@ -21,7 +21,7 @@ import triggerHapticFeedback, { HapticFeedbackTypes } from '../../blue_modules/h import SafeArea from '../../components/SafeArea'; import presentAlert from '../../components/Alert'; import { scanQrHelper } from '../../helpers/scan-qr'; -import { isTablet } from 'react-native-device-info'; +import { isTablet } from '../../blue_modules/environment'; const BROADCAST_RESULT = Object.freeze({ none: 'Input transaction hex', @@ -117,7 +117,7 @@ const Broadcast: React.FC = () => { return ( - + {BROADCAST_RESULT.success !== broadcastResult && ( diff --git a/tests/setup.js b/tests/setup.js index b2803823f..fc9b4c650 100644 --- a/tests/setup.js +++ b/tests/setup.js @@ -59,6 +59,7 @@ jest.mock('react-native-device-info', () => { getDeviceType: jest.fn().mockReturnValue(false), hasGmsSync: jest.fn().mockReturnValue(true), hasHmsSync: jest.fn().mockReturnValue(false), + isTablet: jest.fn().mockReturnValue(false), }; });