REF: Xpub lazy

This commit is contained in:
Marcos Rodriguez Velez 2024-05-09 21:30:25 -04:00
parent d2441d500f
commit 4b85886892
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
3 changed files with 39 additions and 24 deletions

View file

@ -30,7 +30,6 @@ import SelectWallet from './screen/wallets/selectWallet';
import SignVerify from './screen/wallets/signVerify';
import WalletTransactions from './screen/wallets/transactions';
import ViewEditMultisigCosigners from './screen/wallets/ViewEditMultisigCosigners';
import WalletXpub from './screen/wallets/xpub';
import CPFP from './screen/transactions/CPFP';
import RBFBumpFee from './screen/transactions/RBFBumpFee';
@ -73,6 +72,7 @@ import ReceiveDetailsStackRoot from './navigation/ReceiveDetailsStack';
import ScanLndInvoiceRoot from './navigation/ScanLndInvoiceStack';
import { useExtendedNavigation } from './hooks/useExtendedNavigation';
import ReorderWalletsStackRoot from './navigation/ReorderWalletsStack';
import WalletXpubStackRoot from './navigation/WalletXpubStack';
const LDKOpenChannelStack = createNativeStackNavigator();
const LDKOpenChannelRoot = () => {
@ -146,29 +146,6 @@ const DrawerRoot = () => {
);
};
const WalletXpubStack = createNativeStackNavigator();
const WalletXpubStackRoot = () => {
const theme = useTheme();
return (
<WalletXpubStack.Navigator
id="WalletXpubRoot"
screenOptions={{ headerShadowVisible: false, statusBarStyle: 'light' }}
initialRouteName="WalletXpub"
>
<WalletXpubStack.Screen
name="WalletXpub"
component={WalletXpub}
options={navigationStyle({
closeButton: true,
headerBackVisible: false,
headerTitle: loc.wallets.xpub_title,
})(theme)}
/>
</WalletXpubStack.Navigator>
);
};
const SignVerifyStack = createNativeStackNavigator();
const SignVerifyStackRoot = () => {
const theme = useTheme();

View file

@ -0,0 +1,10 @@
import React, { lazy, Suspense } from 'react';
import { LazyLoadingIndicator } from './LazyLoadingIndicator';
const WalletXpub = lazy(() => import('../screen/wallets/xpub'));
export const WalletXpubComponent = () => (
<Suspense fallback={<LazyLoadingIndicator />}>
<WalletXpub />
</Suspense>
);

View file

@ -0,0 +1,28 @@
import React from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { WalletXpubComponent } from './LazyLoadWalletXpubStack';
import { useTheme } from '../components/themes';
import navigationStyle from '../components/navigationStyle';
import loc from '../loc';
const Stack = createNativeStackNavigator();
const WalletXpubStackRoot = () => {
const theme = useTheme();
return (
<Stack.Navigator screenOptions={{ headerShadowVisible: false, statusBarStyle: 'light' }} initialRouteName="WalletXpub">
<Stack.Screen
name="WalletXpub"
component={WalletXpubComponent}
options={navigationStyle({
closeButton: true,
headerBackVisible: false,
headerTitle: loc.wallets.xpub_title,
})(theme)}
/>
</Stack.Navigator>
);
};
export default WalletXpubStackRoot;