import { DrawerNavigationOptions, createDrawerNavigator } from '@react-navigation/drawer'; import { NativeStackNavigationOptions, createNativeStackNavigator } from '@react-navigation/native-stack'; import React, { useContext, useMemo } from 'react'; import { I18nManager, Platform } 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/WalletsList'; 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 } from './blue_modules/environment'; import navigationStyle from './components/navigationStyle'; import { useTheme } from './components/themes'; import loc from './loc'; 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'; import { useIsLargeScreen } from './hooks/useIsLargeScreen'; import { HeaderRightButton } from './components/HeaderRightButton'; 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 ReorderWalletsStack = createNativeStackNavigator(); const ReorderWalletsStackRoot = () => { const theme = useTheme(); return ( ); }; const DrawerListContent = (props: any) => { return ; }; const Drawer = createDrawerNavigator(); const DrawerRoot = () => { const isLargeScreen = useIsLargeScreen(); 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 DetailViewRoot = createNativeStackNavigator(); const DetailViewStackScreensStack = () => { const { walletsInitialized } = useContext(BlueStorageContext); const theme = useTheme(); const SaveButton = useMemo(() => { return ; }, []); return ( {!walletsInitialized ? ( ) : ( SaveButton, })(theme)} /> {/* screens */} )} ); }; 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 NavigationDefaultOptions: NativeStackNavigationOptions = { headerShown: false, presentation: 'modal' }; const NavigationFormModalOptions: NativeStackNavigationOptions = { headerShown: false, presentation: 'formSheet', }; const NavigationDefaultOptionsForDesktop: NativeStackNavigationOptions = { headerShown: false, presentation: 'fullScreenModal' }; const StatusBarLightOptions: NativeStackNavigationOptions = { statusBarStyle: 'light' }; const MainRoot = () => { return isHandset ? : ; }; export default MainRoot;