diff --git a/Navigation.tsx b/Navigation.tsx index 7f10794b5..c08b4b221 100644 --- a/Navigation.tsx +++ b/Navigation.tsx @@ -39,7 +39,6 @@ import TransactionStatus from './screen/transactions/TransactionStatus'; import AztecoRedeem from './screen/receive/aztecoRedeem'; -import ScanQRCode from './screen/send/ScanQRCode'; import Broadcast from './screen/send/Broadcast'; import IsItMyAddress from './screen/send/isItMyAddress'; import Success from './screen/send/success'; @@ -73,6 +72,7 @@ import ScanLndInvoiceRoot from './navigation/ScanLndInvoiceStack'; import { useExtendedNavigation } from './hooks/useExtendedNavigation'; import ReorderWalletsStackRoot from './navigation/ReorderWalletsStack'; import WalletXpubStackRoot from './navigation/WalletXpubStack'; +import ScanQRCodeStackRoot from './navigation/ScanQRCodeStack'; const LDKOpenChannelStack = createNativeStackNavigator(); const LDKOpenChannelRoot = () => { @@ -107,17 +107,6 @@ const AztecoRedeemRoot = () => { ); }; -const ScanQRCodeStack = createNativeStackNavigator(); -const ScanQRCodeRoot = () => ( - - - -); - const DrawerListContent = (props: any) => { return ; }; @@ -396,13 +385,25 @@ const DetailViewStackScreensStack = () => { diff --git a/navigation/LazyLoadScanQRCodeStack.tsx b/navigation/LazyLoadScanQRCodeStack.tsx new file mode 100644 index 000000000..7dd7259d0 --- /dev/null +++ b/navigation/LazyLoadScanQRCodeStack.tsx @@ -0,0 +1,10 @@ +import React, { lazy, Suspense } from 'react'; +import { LazyLoadingIndicator } from './LazyLoadingIndicator'; + +const ScanQRCode = lazy(() => import('../screen/send/ScanQRCode')); + +export const ScanQRCodeComponent = () => ( + }> + + +); diff --git a/navigation/ScanQRCodeStack.tsx b/navigation/ScanQRCodeStack.tsx new file mode 100644 index 000000000..62f581047 --- /dev/null +++ b/navigation/ScanQRCodeStack.tsx @@ -0,0 +1,28 @@ +import React from 'react'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { ScanQRCodeComponent } from './LazyLoadScanQRCodeStack'; +import { useTheme } from '../components/themes'; +import navigationStyle from '../components/navigationStyle'; +import loc from '../loc'; + +const Stack = createNativeStackNavigator(); + +const ScanQRCodeStackRoot = () => { + const theme = useTheme(); + + return ( + + + + ); +}; + +export default ScanQRCodeStackRoot; diff --git a/screen/send/ScanQRCode.js b/screen/send/ScanQRCode.js index 4e11c6439..41b06ad36 100644 --- a/screen/send/ScanQRCode.js +++ b/screen/send/ScanQRCode.js @@ -402,17 +402,4 @@ const ScanQRCode = () => { return {render}; }; -export default ScanQRCode; -ScanQRCode.initialParams = { - isLoading: false, - cameraStatusGranted: undefined, - backdoorPressed: undefined, - launchedBy: undefined, - urTotal: undefined, - urHave: undefined, - backdoorText: '', - onDismiss: undefined, - showFileImportButton: true, - backdoorVisible: false, - animatedQRCodeData: {}, -}; +export default ScanQRCode; \ No newline at end of file