import { DrawerNavigationOptions, createDrawerNavigator } from '@react-navigation/drawer'; import { NativeStackNavigationOptions, createNativeStackNavigator } from '@react-navigation/native-stack'; import React, { useContext, useMemo } from 'react'; import { Dimensions, I18nManager, Platform, useWindowDimensions } from 'react-native'; import PlausibleDeniability from './screen/PlausibleDeniability'; import Selftest from './screen/selftest'; import Currency from './screen/settings/Currency'; import GeneralSettings from './screen/settings/GeneralSettings'; import Licensing from './screen/settings/Licensing'; import NetworkSettings from './screen/settings/NetworkSettings'; import Settings from './screen/settings/Settings'; import About from './screen/settings/about'; import DefaultView from './screen/settings/defaultView'; import ElectrumSettings from './screen/settings/electrumSettings'; import EncryptStorage from './screen/settings/encryptStorage'; import Language from './screen/settings/language'; import LightningSettings from './screen/settings/lightningSettings'; import NotificationSettings from './screen/settings/notificationSettings'; import ReleaseNotes from './screen/settings/releasenotes'; import Tools from './screen/settings/tools'; import AddWallet from './screen/wallets/add'; import WalletsAddMultisig from './screen/wallets/addMultisig'; import WalletsAddMultisigHelp, { WalletAddMultisigHelpNavigationOptions } from './screen/wallets/addMultisigHelp'; import WalletsAddMultisigStep2 from './screen/wallets/addMultisigStep2'; import WalletAddresses from './screen/wallets/addresses'; import WalletDetails from './screen/wallets/details'; import WalletExport from './screen/wallets/export'; import ExportMultisigCoordinationSetup from './screen/wallets/exportMultisigCoordinationSetup'; import GenerateWord from './screen/wallets/generateWord'; import ImportWallet from './screen/wallets/import'; import ImportCustomDerivationPath from './screen/wallets/importCustomDerivationPath'; import ImportWalletDiscovery from './screen/wallets/importDiscovery'; import ImportSpeed from './screen/wallets/importSpeed'; import WalletsList from './screen/wallets/list'; import PleaseBackup from './screen/wallets/pleaseBackup'; import PleaseBackupLNDHub from './screen/wallets/pleaseBackupLNDHub'; import PleaseBackupLdk from './screen/wallets/pleaseBackupLdk'; import ProvideEntropy from './screen/wallets/provideEntropy'; import ReorderWallets from './screen/wallets/reorderWallets'; 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'; import RBFCancel from './screen/transactions/RBFCancel'; import TransactionDetails from './screen/transactions/details'; import TransactionStatus from './screen/transactions/transactionStatus'; import AztecoRedeem from './screen/receive/aztecoRedeem'; import ReceiveDetails from './screen/receive/details'; import ScanQRCode from './screen/send/ScanQRCode'; import Broadcast from './screen/send/broadcast'; import CoinControl from './screen/send/coinControl'; import Confirm from './screen/send/confirm'; import SendCreate from './screen/send/create'; import SendDetails from './screen/send/details'; import IsItMyAddress from './screen/send/isItMyAddress'; import PsbtMultisig from './screen/send/psbtMultisig'; import PsbtMultisigQRCode from './screen/send/psbtMultisigQRCode'; import PsbtWithHardwareWallet from './screen/send/psbtWithHardwareWallet'; import Success from './screen/send/success'; import UnlockWith from './screen/UnlockWith'; import { isDesktop, isHandset, isTablet } from './blue_modules/environment'; import navigationStyle from './components/navigationStyle'; import { useTheme } from './components/themes'; import loc from './loc'; import LappBrowser from './screen/lnd/browser'; import LdkInfo from './screen/lnd/ldkInfo'; import LdkOpenChannel from './screen/lnd/ldkOpenChannel'; import LNDCreateInvoice from './screen/lnd/lndCreateInvoice'; import LNDViewAdditionalInvoiceInformation from './screen/lnd/lndViewAdditionalInvoiceInformation'; import LNDViewAdditionalInvoicePreImage from './screen/lnd/lndViewAdditionalInvoicePreImage'; import LNDViewInvoice from './screen/lnd/lndViewInvoice'; import LnurlAuth from './screen/lnd/lnurlAuth'; import LnurlPay from './screen/lnd/lnurlPay'; import LnurlPaySuccess from './screen/lnd/lnurlPaySuccess'; import ScanLndInvoice from './screen/lnd/scanLndInvoice'; import SettingsPrivacy from './screen/settings/SettingsPrivacy'; import DrawerList from './screen/wallets/DrawerList'; import LdkViewLogs from './screen/wallets/ldkViewLogs'; import PaymentCode from './screen/wallets/paymentCode'; import PaymentCodesList from './screen/wallets/paymentCodesList'; import { BlueStorageContext } from './blue_modules/storage-context'; const WalletsStack = createNativeStackNavigator(); const WalletsRoot = () => { const theme = useTheme(); return ( ); }; const AddWalletStack = createNativeStackNavigator(); const AddWalletRoot = () => { const theme = useTheme(); return ( ); }; // CreateTransactionStackNavigator === SendDetailsStack const SendDetailsStack = createNativeStackNavigator(); const SendDetailsRoot = () => { const theme = useTheme(); return ( ); }; const LNDCreateInvoiceStack = createNativeStackNavigator(); const LNDCreateInvoiceRoot = () => { const theme = useTheme(); return ( ); }; // LightningScanInvoiceStackNavigator === ScanLndInvoiceStack const ScanLndInvoiceStack = createNativeStackNavigator(); const ScanLndInvoiceRoot = () => { const theme = useTheme(); return ( ); }; const LDKOpenChannelStack = createNativeStackNavigator(); const LDKOpenChannelRoot = () => { const theme = useTheme(); return ( ); }; const AztecoRedeemStack = createNativeStackNavigator(); const AztecoRedeemRoot = () => { const theme = useTheme(); return ( ); }; const ScanQRCodeStack = createNativeStackNavigator(); const ScanQRCodeRoot = () => ( ); const UnlockWithScreenStack = createNativeStackNavigator(); const UnlockWithScreenRoot = () => ( ); const ReorderWalletsStack = createNativeStackNavigator(); const ReorderWalletsStackRoot = () => { const theme = useTheme(); return ( ); }; const DrawerListContent = (props: any) => { return ; }; const Drawer = createDrawerNavigator(); const DrawerRoot = () => { const dimensions = useWindowDimensions(); const isLargeScreen = useMemo(() => { return Platform.OS === 'android' ? isTablet() : (dimensions.width >= Dimensions.get('screen').width / 2 && isTablet()) || isDesktop; }, [dimensions.width]); const drawerStyle: DrawerNavigationOptions = useMemo( () => ({ drawerPosition: I18nManager.isRTL ? 'right' : 'left', drawerStyle: { width: isLargeScreen ? 320 : '0%' }, drawerType: isLargeScreen ? 'permanent' : 'back', }), [isLargeScreen], ); return ( ); }; const ReceiveDetailsStack = createNativeStackNavigator(); const ReceiveDetailsStackRoot = () => { const theme = useTheme(); return ( ); }; const WalletXpubStack = createNativeStackNavigator(); const WalletXpubStackRoot = () => { const theme = useTheme(); return ( ); }; const SignVerifyStack = createNativeStackNavigator(); const SignVerifyStackRoot = () => { const theme = useTheme(); return ( ); }; const WalletExportStack = createNativeStackNavigator(); const WalletExportStackRoot = () => { const theme = useTheme(); return ( ); }; const LappBrowserStack = createNativeStackNavigator(); const LappBrowserStackRoot = () => { const theme = useTheme(); return ( ); }; const InitStack = createNativeStackNavigator(); const InitRoot = () => { const { walletsInitialized } = useContext(BlueStorageContext); return ( {!walletsInitialized ? ( ) : ( )} ); }; export type ViewEditMultisigCosignersStackParamsList = { ViewEditMultisigCosigners: { walletId: string }; }; const ViewEditMultisigCosignersStack = createNativeStackNavigator(); const ViewEditMultisigCosignersRoot = () => { const theme = useTheme(); return ( ); }; const ExportMultisigCoordinationSetupStack = createNativeStackNavigator(); const ExportMultisigCoordinationSetupRoot = () => { const theme = useTheme(); return ( ); }; export type PaymentCodeStackParamList = { PaymentCode: { paymentCode: string }; PaymentCodesList: { walletID: string }; }; const PaymentCodeStack = createNativeStackNavigator(); const PaymentCodeStackRoot = () => { return ( ); }; const RootStack = createNativeStackNavigator(); const NavigationDefaultOptions: NativeStackNavigationOptions = { headerShown: false, presentation: 'modal' }; const NavigationFormModalOptions: NativeStackNavigationOptions = { headerShown: false, presentation: 'formSheet', }; const StatusBarLightOptions: NativeStackNavigationOptions = { statusBarStyle: 'light' }; const Navigation = () => { return ( {/* stacks */} {/* screens */} ); }; export default InitRoot;