mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-23 15:20:55 +01:00
REF: Xpub lazy
This commit is contained in:
parent
d2441d500f
commit
4b85886892
3 changed files with 39 additions and 24 deletions
|
@ -30,7 +30,6 @@ import SelectWallet from './screen/wallets/selectWallet';
|
||||||
import SignVerify from './screen/wallets/signVerify';
|
import SignVerify from './screen/wallets/signVerify';
|
||||||
import WalletTransactions from './screen/wallets/transactions';
|
import WalletTransactions from './screen/wallets/transactions';
|
||||||
import ViewEditMultisigCosigners from './screen/wallets/ViewEditMultisigCosigners';
|
import ViewEditMultisigCosigners from './screen/wallets/ViewEditMultisigCosigners';
|
||||||
import WalletXpub from './screen/wallets/xpub';
|
|
||||||
|
|
||||||
import CPFP from './screen/transactions/CPFP';
|
import CPFP from './screen/transactions/CPFP';
|
||||||
import RBFBumpFee from './screen/transactions/RBFBumpFee';
|
import RBFBumpFee from './screen/transactions/RBFBumpFee';
|
||||||
|
@ -73,6 +72,7 @@ import ReceiveDetailsStackRoot from './navigation/ReceiveDetailsStack';
|
||||||
import ScanLndInvoiceRoot from './navigation/ScanLndInvoiceStack';
|
import ScanLndInvoiceRoot from './navigation/ScanLndInvoiceStack';
|
||||||
import { useExtendedNavigation } from './hooks/useExtendedNavigation';
|
import { useExtendedNavigation } from './hooks/useExtendedNavigation';
|
||||||
import ReorderWalletsStackRoot from './navigation/ReorderWalletsStack';
|
import ReorderWalletsStackRoot from './navigation/ReorderWalletsStack';
|
||||||
|
import WalletXpubStackRoot from './navigation/WalletXpubStack';
|
||||||
|
|
||||||
const LDKOpenChannelStack = createNativeStackNavigator();
|
const LDKOpenChannelStack = createNativeStackNavigator();
|
||||||
const LDKOpenChannelRoot = () => {
|
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 SignVerifyStack = createNativeStackNavigator();
|
||||||
const SignVerifyStackRoot = () => {
|
const SignVerifyStackRoot = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
10
navigation/LazyLoadWalletXpubStack.tsx
Normal file
10
navigation/LazyLoadWalletXpubStack.tsx
Normal 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>
|
||||||
|
);
|
28
navigation/WalletXpubStack.tsx
Normal file
28
navigation/WalletXpubStack.tsx
Normal 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;
|
Loading…
Add table
Reference in a new issue