BlueWallet/Navigation.js

549 lines
27 KiB
JavaScript
Raw Normal View History

2020-05-27 13:12:17 +02:00
import React from 'react';
2021-09-13 19:43:26 +02:00
import { createNativeStackNavigator } from 'react-native-screens/native-stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
2021-03-11 07:13:00 +01:00
import { Platform, useWindowDimensions, Dimensions, I18nManager } from 'react-native';
2020-12-25 17:09:53 +01:00
import { useTheme } from '@react-navigation/native';
2020-05-27 13:12:17 +02:00
import Settings from './screen/settings/settings';
import About from './screen/settings/about';
import ReleaseNotes from './screen/settings/releasenotes';
import Licensing from './screen/settings/licensing';
import Selftest from './screen/selftest';
import Language from './screen/settings/language';
import Currency from './screen/settings/currency';
import EncryptStorage from './screen/settings/encryptStorage';
import PlausibleDeniability from './screen/plausibledeniability';
import LightningSettings from './screen/settings/lightningSettings';
import ElectrumSettings from './screen/settings/electrumSettings';
2021-04-23 13:29:45 +02:00
import TorSettings from './screen/settings/torSettings';
import Tools from './screen/settings/tools';
2020-05-27 13:12:17 +02:00
import GeneralSettings from './screen/settings/GeneralSettings';
import NetworkSettings from './screen/settings/NetworkSettings';
2020-07-31 15:43:55 +02:00
import NotificationSettings from './screen/settings/notificationSettings';
2020-05-27 13:12:17 +02:00
import DefaultView from './screen/settings/defaultView';
import WalletsList from './screen/wallets/list';
import WalletTransactions from './screen/wallets/transactions';
import AddWallet from './screen/wallets/add';
import WalletsAddMultisig from './screen/wallets/addMultisig';
import WalletsAddMultisigStep2 from './screen/wallets/addMultisigStep2';
2020-12-07 17:48:56 +01:00
import WalletsAddMultisigHelp from './screen/wallets/addMultisigHelp';
2020-05-27 13:12:17 +02:00
import PleaseBackup from './screen/wallets/pleaseBackup';
import PleaseBackupLNDHub from './screen/wallets/pleaseBackupLNDHub';
2021-09-09 13:00:11 +02:00
import PleaseBackupLdk from './screen/wallets/pleaseBackupLdk';
2020-05-27 13:12:17 +02:00
import ImportWallet from './screen/wallets/import';
import ImportWalletDiscovery from './screen/wallets/importDiscovery';
import ImportCustomDerivationPath from './screen/wallets/importCustomDerivationPath';
import ImportSpeed from './screen/wallets/importSpeed';
2020-05-27 13:12:17 +02:00
import WalletDetails from './screen/wallets/details';
import WalletExport from './screen/wallets/export';
2020-10-05 23:25:14 +02:00
import ExportMultisigCoordinationSetup from './screen/wallets/exportMultisigCoordinationSetup';
import ViewEditMultisigCosigners from './screen/wallets/viewEditMultisigCosigners';
2020-05-27 13:12:17 +02:00
import WalletXpub from './screen/wallets/xpub';
2021-03-23 13:16:32 +01:00
import SignVerify from './screen/wallets/signVerify';
2021-02-04 08:05:37 +01:00
import WalletAddresses from './screen/wallets/addresses';
2020-05-27 13:12:17 +02:00
import BuyBitcoin from './screen/wallets/buyBitcoin';
import HodlHodl from './screen/wallets/hodlHodl';
2020-06-15 20:47:54 +02:00
import HodlHodlViewOffer from './screen/wallets/hodlHodlViewOffer';
import HodlHodlLogin from './screen/wallets/hodlHodlLogin';
import HodlHodlWebview from './screen/wallets/hodlHodlWebview';
import HodlHodlMyContracts from './screen/wallets/hodlHodlMyContracts';
2020-05-27 13:12:17 +02:00
import Marketplace from './screen/wallets/marketplace';
import ReorderWallets from './screen/wallets/reorderWallets';
import SelectWallet from './screen/wallets/selectWallet';
2020-06-29 14:58:43 +02:00
import ProvideEntropy from './screen/wallets/provideEntropy';
2021-04-15 19:46:10 +02:00
import AOPP from './screen/wallets/aopp';
2020-05-27 13:12:17 +02:00
import TransactionDetails from './screen/transactions/details';
import TransactionStatus from './screen/transactions/transactionStatus';
import CPFP from './screen/transactions/CPFP';
import RBFBumpFee from './screen/transactions/RBFBumpFee';
import RBFCancel from './screen/transactions/RBFCancel';
import ReceiveDetails from './screen/receive/details';
import AztecoRedeem from './screen/receive/aztecoRedeem';
2020-05-27 13:12:17 +02:00
import SendDetails from './screen/send/details';
import ScanQRCode from './screen/send/ScanQRCode';
import SendCreate from './screen/send/create';
import Confirm from './screen/send/confirm';
import PsbtWithHardwareWallet from './screen/send/psbtWithHardwareWallet';
2020-10-05 23:25:14 +02:00
import PsbtMultisig from './screen/send/psbtMultisig';
2021-02-18 14:37:43 +01:00
import PsbtMultisigQRCode from './screen/send/psbtMultisigQRCode';
2020-05-27 13:12:17 +02:00
import Success from './screen/send/success';
import Broadcast from './screen/send/broadcast';
import IsItMyAddress from './screen/send/isItMyAddress';
2020-10-22 14:24:47 +02:00
import CoinControl from './screen/send/coinControl';
2020-05-27 13:12:17 +02:00
import ScanLndInvoice from './screen/lnd/scanLndInvoice';
import LappBrowser from './screen/lnd/browser';
import LNDCreateInvoice from './screen/lnd/lndCreateInvoice';
import LNDViewInvoice from './screen/lnd/lndViewInvoice';
2021-09-09 13:00:11 +02:00
import LdkOpenChannel from './screen/lnd/ldkOpenChannel';
import LdkInfo from './screen/lnd/ldkInfo';
2020-05-27 13:12:17 +02:00
import LNDViewAdditionalInvoiceInformation from './screen/lnd/lndViewAdditionalInvoiceInformation';
2020-07-23 20:06:13 +02:00
import LnurlPay from './screen/lnd/lnurlPay';
import LnurlPaySuccess from './screen/lnd/lnurlPaySuccess';
import UnlockWith from './UnlockWith';
import DrawerList from './screen/wallets/drawerList';
2021-09-14 07:36:09 +02:00
import { isDesktop, isTablet, isHandset } from './blue_modules/environment';
import SettingsPrivacy from './screen/settings/SettingsPrivacy';
2020-11-28 04:24:20 +01:00
import LNDViewAdditionalInvoicePreImage from './screen/lnd/lndViewAdditionalInvoicePreImage';
2021-09-09 13:00:11 +02:00
import LdkViewLogs from './screen/wallets/ldkViewLogs';
2020-05-27 13:12:17 +02:00
2021-09-13 19:43:26 +02:00
const WalletsStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const WalletsRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<WalletsStack.Navigator screenOptions={{ headerHideShadow: true }}>
2021-03-11 14:43:21 +01:00
<WalletsStack.Screen name="WalletsList" component={WalletsList} options={WalletsList.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<WalletsStack.Screen name="WalletTransactions" component={WalletTransactions} options={WalletTransactions.navigationOptions(theme)} />
2021-09-09 13:00:11 +02:00
<WalletsStack.Screen name="LdkOpenChannel" component={LdkOpenChannel} options={LdkOpenChannel.navigationOptions(theme)} />
<WalletsStack.Screen name="LdkInfo" component={LdkInfo} options={LdkInfo.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<WalletsStack.Screen name="WalletDetails" component={WalletDetails} options={WalletDetails.navigationOptions(theme)} />
2021-09-09 13:00:11 +02:00
<WalletsStack.Screen name="LdkViewLogs" component={LdkViewLogs} options={LdkViewLogs.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<WalletsStack.Screen name="TransactionDetails" component={TransactionDetails} options={TransactionDetails.navigationOptions(theme)} />
<WalletsStack.Screen name="TransactionStatus" component={TransactionStatus} options={TransactionStatus.navigationOptions(theme)} />
<WalletsStack.Screen name="HodlHodl" component={HodlHodl} options={HodlHodl.navigationOptions(theme)} />
<WalletsStack.Screen name="HodlHodlViewOffer" component={HodlHodlViewOffer} options={HodlHodlViewOffer.navigationOptions(theme)} />
<WalletsStack.Screen name="CPFP" component={CPFP} options={CPFP.navigationOptions(theme)} />
<WalletsStack.Screen name="RBFBumpFee" component={RBFBumpFee} options={RBFBumpFee.navigationOptions(theme)} />
<WalletsStack.Screen name="RBFCancel" component={RBFCancel} options={RBFCancel.navigationOptions(theme)} />
<WalletsStack.Screen name="Settings" component={Settings} options={Settings.navigationOptions(theme)} />
<WalletsStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
<WalletsStack.Screen name="Currency" component={Currency} options={Currency.navigationOptions(theme)} />
<WalletsStack.Screen name="About" component={About} options={About.navigationOptions(theme)} />
<WalletsStack.Screen name="ReleaseNotes" component={ReleaseNotes} options={ReleaseNotes.navigationOptions(theme)} />
<WalletsStack.Screen name="Selftest" component={Selftest} options={Selftest.navigationOptions(theme)} />
<WalletsStack.Screen name="Licensing" component={Licensing} options={Licensing.navigationOptions(theme)} />
<WalletsStack.Screen name="DefaultView" component={DefaultView} options={DefaultView.navigationOptions(theme)} />
<WalletsStack.Screen name="Language" component={Language} options={Language.navigationOptions(theme)} />
<WalletsStack.Screen name="EncryptStorage" component={EncryptStorage} options={EncryptStorage.navigationOptions(theme)} />
<WalletsStack.Screen name="GeneralSettings" component={GeneralSettings} options={GeneralSettings.navigationOptions(theme)} />
<WalletsStack.Screen name="NetworkSettings" component={NetworkSettings} options={NetworkSettings.navigationOptions(theme)} />
<WalletsStack.Screen
name="NotificationSettings"
component={NotificationSettings}
options={NotificationSettings.navigationOptions(theme)}
/>
<WalletsStack.Screen
name="PlausibleDeniability"
component={PlausibleDeniability}
options={PlausibleDeniability.navigationOptions(theme)}
/>
<WalletsStack.Screen name="LightningSettings" component={LightningSettings} options={LightningSettings.navigationOptions(theme)} />
<WalletsStack.Screen name="ElectrumSettings" component={ElectrumSettings} options={ElectrumSettings.navigationOptions(theme)} />
2021-04-23 13:29:45 +02:00
<WalletsStack.Screen name="TorSettings" component={TorSettings} options={TorSettings.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<WalletsStack.Screen name="SettingsPrivacy" component={SettingsPrivacy} options={SettingsPrivacy.navigationOptions(theme)} />
<WalletsStack.Screen name="Tools" component={Tools} options={Tools.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<WalletsStack.Screen name="LNDViewInvoice" component={LNDViewInvoice} options={LNDViewInvoice.navigationOptions(theme)} />
<WalletsStack.Screen
name="LNDViewAdditionalInvoiceInformation"
component={LNDViewAdditionalInvoiceInformation}
options={LNDViewAdditionalInvoiceInformation.navigationOptions(theme)}
/>
<WalletsStack.Screen
name="LNDViewAdditionalInvoicePreImage"
component={LNDViewAdditionalInvoicePreImage}
options={LNDViewAdditionalInvoicePreImage.navigationOptions(theme)}
/>
<WalletsStack.Screen name="Broadcast" component={Broadcast} options={Broadcast.navigationOptions(theme)} />
<WalletsStack.Screen name="IsItMyAddress" component={IsItMyAddress} options={IsItMyAddress.navigationOptions(theme)} />
<WalletsStack.Screen name="LnurlPay" component={LnurlPay} options={LnurlPay.navigationOptions(theme)} />
<WalletsStack.Screen name="LnurlPaySuccess" component={LnurlPaySuccess} options={LnurlPaySuccess.navigationOptions(theme)} />
<WalletsStack.Screen
name="Success"
component={Success}
options={{
headerShown: false,
gestureEnabled: false,
}}
/>
2021-04-16 16:05:25 +02:00
<WalletsStack.Screen name="WalletAddresses" component={WalletAddresses} options={WalletAddresses.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
</WalletsStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
2021-09-13 19:43:26 +02:00
const AddWalletStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const AddWalletRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<AddWalletStack.Navigator screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<AddWalletStack.Screen name="AddWallet" component={AddWallet} options={AddWallet.navigationOptions(theme)} />
<AddWalletStack.Screen name="ImportWallet" component={ImportWallet} options={ImportWallet.navigationOptions(theme)} />
<AddWalletStack.Screen
name="ImportWalletDiscovery"
component={ImportWalletDiscovery}
options={ImportWalletDiscovery.navigationOptions(theme)}
/>
<AddWalletStack.Screen
name="ImportCustomDerivationPath"
component={ImportCustomDerivationPath}
options={ImportCustomDerivationPath.navigationOptions(theme)}
/>
<AddWalletStack.Screen name="ImportSpeed" component={ImportSpeed} options={ImportSpeed.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<AddWalletStack.Screen name="PleaseBackup" component={PleaseBackup} options={PleaseBackup.navigationOptions(theme)} />
<AddWalletStack.Screen
name="PleaseBackupLNDHub"
component={PleaseBackupLNDHub}
options={PleaseBackupLNDHub.navigationOptions(theme)}
/>
2021-09-09 13:00:11 +02:00
<AddWalletStack.Screen name="PleaseBackupLdk" component={PleaseBackupLdk} options={PleaseBackupLdk.navigationOptions(theme)} />
2020-12-25 17:09:53 +01:00
<AddWalletStack.Screen name="ProvideEntropy" component={ProvideEntropy} options={ProvideEntropy.navigationOptions(theme)} />
<AddWalletStack.Screen
name="WalletsAddMultisig"
component={WalletsAddMultisig}
options={WalletsAddMultisig.navigationOptions(theme)}
/>
<AddWalletStack.Screen
name="WalletsAddMultisigStep2"
component={WalletsAddMultisigStep2}
options={WalletsAddMultisigStep2.navigationOptions(theme)}
/>
<AddWalletStack.Screen
name="WalletsAddMultisigHelp"
component={WalletsAddMultisigHelp}
options={WalletsAddMultisigHelp.navigationOptions(theme)}
/>
</AddWalletStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
// CreateTransactionStackNavigator === SendDetailsStack
2021-09-13 19:43:26 +02:00
const SendDetailsStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const SendDetailsRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<SendDetailsStack.Navigator screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<SendDetailsStack.Screen name="SendDetails" component={SendDetails} options={SendDetails.navigationOptions(theme)} />
<SendDetailsStack.Screen name="Confirm" component={Confirm} options={Confirm.navigationOptions(theme)} />
<SendDetailsStack.Screen
name="PsbtWithHardwareWallet"
component={PsbtWithHardwareWallet}
options={PsbtWithHardwareWallet.navigationOptions(theme)}
/>
<SendDetailsStack.Screen name="CreateTransaction" component={SendCreate} options={SendCreate.navigationOptions(theme)} />
<SendDetailsStack.Screen name="PsbtMultisig" component={PsbtMultisig} options={PsbtMultisig.navigationOptions(theme)} />
<SendDetailsStack.Screen
name="PsbtMultisigQRCode"
component={PsbtMultisigQRCode}
options={PsbtMultisigQRCode.navigationOptions(theme)}
/>
<SendDetailsStack.Screen
name="Success"
component={Success}
options={{
headerShown: false,
gestureEnabled: false,
}}
/>
<SendDetailsStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
<SendDetailsStack.Screen name="CoinControl" component={CoinControl} options={CoinControl.navigationOptions(theme)} />
</SendDetailsStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
2021-09-13 19:43:26 +02:00
const LNDCreateInvoiceStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const LNDCreateInvoiceRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<LNDCreateInvoiceStack.Navigator screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<LNDCreateInvoiceStack.Screen
name="LNDCreateInvoice"
component={LNDCreateInvoice}
options={LNDCreateInvoice.navigationOptions(theme)}
/>
<LNDCreateInvoiceStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
<LNDCreateInvoiceStack.Screen name="LNDViewInvoice" component={LNDViewInvoice} options={LNDViewInvoice.navigationOptions(theme)} />
<LNDCreateInvoiceStack.Screen
name="LNDViewAdditionalInvoiceInformation"
component={LNDViewAdditionalInvoiceInformation}
options={LNDViewAdditionalInvoiceInformation.navigationOptions(theme)}
/>
<LNDCreateInvoiceStack.Screen
name="LNDViewAdditionalInvoicePreImage"
component={LNDViewAdditionalInvoicePreImage}
options={LNDViewAdditionalInvoicePreImage.navigationOptions(theme)}
/>
</LNDCreateInvoiceStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
// LightningScanInvoiceStackNavigator === ScanLndInvoiceStack
2021-09-13 19:43:26 +02:00
const ScanLndInvoiceStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const ScanLndInvoiceRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<ScanLndInvoiceStack.Navigator screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<ScanLndInvoiceStack.Screen name="ScanLndInvoice" component={ScanLndInvoice} options={ScanLndInvoice.navigationOptions(theme)} />
<ScanLndInvoiceStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
<ScanLndInvoiceStack.Screen name="Success" component={Success} options={{ headerShown: false, gestureEnabled: false }} />
<ScanLndInvoiceStack.Screen name="LnurlPay" component={LnurlPay} options={LnurlPay.navigationOptions(theme)} />
<ScanLndInvoiceStack.Screen name="LnurlPaySuccess" component={LnurlPaySuccess} options={LnurlPaySuccess.navigationOptions(theme)} />
</ScanLndInvoiceStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
2021-09-30 13:33:50 +02:00
const LDKOpenChannelStack = createNativeStackNavigator();
const LDKOpenChannelRoot = () => {
const theme = useTheme();
return (
<LDKOpenChannelStack.Navigator name="LDKOpenChannelRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="SelectWallet">
<LDKOpenChannelStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
<LDKOpenChannelStack.Screen
name="LDKOpenChannelSetAmount"
component={LdkOpenChannel}
options={LdkOpenChannel.navigationOptions(theme)}
/>
<LDKOpenChannelStack.Screen name="Success" component={Success} options={{ headerShown: false, gestureEnabled: false }} />
</LDKOpenChannelStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const AztecoRedeemStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const AztecoRedeemRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<AztecoRedeemStack.Navigator screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<AztecoRedeemStack.Screen name="AztecoRedeem" component={AztecoRedeem} options={AztecoRedeem.navigationOptions(theme)} />
2021-09-13 19:43:26 +02:00
<AztecoRedeemStack.Screen name="SelectWallet" component={SelectWallet} />
2020-12-25 17:09:53 +01:00
</AztecoRedeemStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const ScanQRCodeStack = createNativeStackNavigator();
2020-05-30 07:30:43 +02:00
const ScanQRCodeRoot = () => (
<ScanQRCodeStack.Navigator screenOptions={{ headerShown: false, stackPresentation: isDesktop ? 'containedModal' : 'fullScreenModal' }}>
2020-05-30 07:30:43 +02:00
<RootStack.Screen name="ScanQRCode" component={ScanQRCode} />
</ScanQRCodeStack.Navigator>
);
2021-09-13 19:43:26 +02:00
const UnlockWithScreenStack = createNativeStackNavigator();
const UnlockWithScreenRoot = () => (
<UnlockWithScreenStack.Navigator name="UnlockWithScreenRoot" screenOptions={{ headerShown: false }}>
2020-07-21 00:14:02 +02:00
<UnlockWithScreenStack.Screen name="UnlockWithScreen" component={UnlockWith} initialParams={{ unlockOnComponentMount: true }} />
</UnlockWithScreenStack.Navigator>
);
2021-09-13 19:43:26 +02:00
const HodlHodlLoginStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const HodlHodlLoginRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<HodlHodlLoginStack.Navigator name="HodlHodlLoginRoot" screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<HodlHodlLoginStack.Screen name="HodlHodlLogin" component={HodlHodlLogin} options={HodlHodlLogin.navigationOptions(theme)} />
</HodlHodlLoginStack.Navigator>
);
};
2020-07-15 19:32:59 +02:00
2021-09-13 19:43:26 +02:00
const ReorderWalletsStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const ReorderWalletsStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<ReorderWalletsStack.Navigator name="ReorderWalletsRoot" screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
<ReorderWalletsStack.Screen name="ReorderWallets" component={ReorderWallets} options={ReorderWallets.navigationOptions(theme)} />
</ReorderWalletsStack.Navigator>
);
};
2020-09-16 02:48:24 +02:00
const Drawer = createDrawerNavigator();
function DrawerRoot() {
const dimensions = useWindowDimensions();
const isLargeScreen =
Platform.OS === 'android' ? isTablet() : (dimensions.width >= Dimensions.get('screen').width / 2 && isTablet()) || isDesktop;
2021-09-22 18:39:14 +02:00
const drawerStyle = { width: isLargeScreen ? 320 : '0%' };
return (
<Drawer.Navigator
2021-09-22 18:39:14 +02:00
drawerStyle={drawerStyle}
drawerType={isLargeScreen ? 'permanent' : null}
drawerContent={props => (isLargeScreen ? <DrawerList {...props} /> : null)}
2021-03-11 07:13:00 +01:00
drawerPosition={I18nManager.isRTL ? 'right' : 'left'}
>
<Drawer.Screen name="Navigation" component={Navigation} options={{ headerShown: false, gestureEnabled: false }} />
</Drawer.Navigator>
);
}
2021-09-13 19:43:26 +02:00
const ReceiveDetailsStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const ReceiveDetailsStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<ReceiveDetailsStack.Navigator name="ReceiveDetailsRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="ReceiveDetails">
2020-12-25 17:09:53 +01:00
<RootStack.Screen name="ReceiveDetails" component={ReceiveDetails} options={ReceiveDetails.navigationOptions(theme)} />
</ReceiveDetailsStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const WalletXpubStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const WalletXpubStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<WalletXpubStack.Navigator name="WalletXpubRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="WalletXpub">
2020-12-25 17:09:53 +01:00
<WalletXpubStack.Screen name="WalletXpub" component={WalletXpub} options={WalletXpub.navigationOptions(theme)} />
</WalletXpubStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const SignVerifyStack = createNativeStackNavigator();
2021-03-23 13:16:32 +01:00
const SignVerifyStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<SignVerifyStack.Navigator name="SignVerifyRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="SignVerify">
2021-03-23 13:16:32 +01:00
<SignVerifyStack.Screen name="SignVerify" component={SignVerify} options={SignVerify.navigationOptions(theme)} />
</SignVerifyStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const WalletExportStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const WalletExportStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<WalletExportStack.Navigator name="WalletExportRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="WalletExport">
2020-12-25 17:09:53 +01:00
<WalletExportStack.Screen name="WalletExport" component={WalletExport} options={WalletExport.navigationOptions(theme)} />
</WalletExportStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const LappBrowserStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const LappBrowserStackRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<LappBrowserStack.Navigator name="LappBrowserRoot" screenOptions={{ headerHideShadow: true }} initialRouteName="LappBrowser">
2020-12-25 17:09:53 +01:00
<LappBrowserStack.Screen name="LappBrowser" component={LappBrowser} options={LappBrowser.navigationOptions(theme)} />
</LappBrowserStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const InitStack = createNativeStackNavigator();
const InitRoot = () => (
2021-09-13 19:43:26 +02:00
<InitStack.Navigator initialRouteName="UnlockWithScreenRoot">
<InitStack.Screen name="UnlockWithScreenRoot" component={UnlockWithScreenRoot} options={{ headerShown: false }} />
<InitStack.Screen
2021-09-13 19:43:26 +02:00
name="ReorderWallets"
component={ReorderWalletsStackRoot}
options={{ headerShown: false, gestureEnabled: false, stackPresentation: isDesktop ? 'containedModal' : 'fullScreenModal' }}
/>
2021-09-14 07:36:09 +02:00
<InitStack.Screen
name={isHandset ? 'Navigation' : 'DrawerRoot'}
component={isHandset ? Navigation : DrawerRoot}
options={{ headerShown: false, replaceAnimation: 'push' }}
/>
</InitStack.Navigator>
);
2021-09-13 19:43:26 +02:00
const ViewEditMultisigCosignersStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const ViewEditMultisigCosignersRoot = () => {
const theme = useTheme();
return (
<ViewEditMultisigCosignersStack.Navigator
name="ViewEditMultisigCosignersRoot"
initialRouteName="ViewEditMultisigCosigners"
2021-09-13 19:43:26 +02:00
screenOptions={{ headerHideShadow: true }}
2020-12-25 17:09:53 +01:00
>
<ViewEditMultisigCosignersStack.Screen
name="ViewEditMultisigCosigners"
component={ViewEditMultisigCosigners}
options={ViewEditMultisigCosigners.navigationOptions(theme)}
/>
</ViewEditMultisigCosignersStack.Navigator>
);
};
2020-12-12 01:27:43 +01:00
2021-09-13 19:43:26 +02:00
const ExportMultisigCoordinationSetupStack = createNativeStackNavigator();
2020-12-25 17:09:53 +01:00
const ExportMultisigCoordinationSetupRoot = () => {
const theme = useTheme();
2020-12-25 17:09:53 +01:00
return (
<ExportMultisigCoordinationSetupStack.Navigator
name="ExportMultisigCoordinationSetupRoot"
2020-12-25 17:09:53 +01:00
initialRouteName="ExportMultisigCoordinationSetup"
2021-09-13 19:43:26 +02:00
screenOptions={{ headerHideShadow: true }}
2020-12-25 17:09:53 +01:00
>
<ExportMultisigCoordinationSetupStack.Screen
name="ExportMultisigCoordinationSetup"
component={ExportMultisigCoordinationSetup}
options={ExportMultisigCoordinationSetup.navigationOptions(theme)}
/>
</ExportMultisigCoordinationSetupStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const AOPPStack = createNativeStackNavigator();
2021-04-15 19:46:10 +02:00
const AOPPRoot = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<AOPPStack.Navigator screenOptions={{ headerHideShadow: true }}>
2021-09-24 17:50:53 +02:00
<AOPPStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions(theme)} />
2021-04-15 19:46:10 +02:00
<AOPPStack.Screen name="AOPP" component={AOPP} options={AOPP.navigationOptions(theme)} />
<AOPPStack.Screen name="SignVerify" component={SignVerify} options={SignVerify.navigationOptions(theme)} />
</AOPPStack.Navigator>
);
};
2021-09-13 19:43:26 +02:00
const RootStack = createNativeStackNavigator();
const NavigationDefaultOptions = { headerShown: false, stackPresentation: isDesktop ? 'containedModal' : 'modal' };
2020-12-25 17:09:53 +01:00
const Navigation = () => {
const theme = useTheme();
return (
2021-09-13 19:43:26 +02:00
<RootStack.Navigator initialRouteName="UnlockWithScreenRoot" screenOptions={{ headerHideShadow: true }}>
2020-12-25 17:09:53 +01:00
{/* stacks */}
2021-09-13 19:43:26 +02:00
<RootStack.Screen name="WalletsRoot" component={WalletsRoot} options={{ headerShown: false, translucent: false }} />
<RootStack.Screen name="AddWalletRoot" component={AddWalletRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="SendDetailsRoot" component={SendDetailsRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="LNDCreateInvoiceRoot" component={LNDCreateInvoiceRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="ScanLndInvoiceRoot" component={ScanLndInvoiceRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="AztecoRedeemRoot" component={AztecoRedeemRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="HodlHodlLoginRoot" component={HodlHodlLoginRoot} options={NavigationDefaultOptions} />
2020-12-25 17:09:53 +01:00
<RootStack.Screen name="HodlHodlMyContracts" component={HodlHodlMyContracts} options={HodlHodlMyContracts.navigationOptions(theme)} />
<RootStack.Screen name="HodlHodlWebview" component={HodlHodlWebview} options={HodlHodlWebview.navigationOptions(theme)} />
{/* screens */}
2021-09-13 19:43:26 +02:00
<RootStack.Screen name="WalletExportRoot" component={WalletExportStackRoot} options={NavigationDefaultOptions} />
2020-12-25 17:09:53 +01:00
<RootStack.Screen
name="ExportMultisigCoordinationSetupRoot"
component={ExportMultisigCoordinationSetupRoot}
options={NavigationDefaultOptions}
2020-12-25 17:09:53 +01:00
/>
2021-09-13 19:43:26 +02:00
<RootStack.Screen name="ViewEditMultisigCosignersRoot" component={ViewEditMultisigCosignersRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="WalletXpubRoot" component={WalletXpubStackRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="SignVerifyRoot" component={SignVerifyStackRoot} options={NavigationDefaultOptions} />
2020-12-25 17:09:53 +01:00
<RootStack.Screen name="BuyBitcoin" component={BuyBitcoin} options={BuyBitcoin.navigationOptions(theme)} />
<RootStack.Screen name="Marketplace" component={Marketplace} options={Marketplace.navigationOptions(theme)} />
2021-09-13 19:43:26 +02:00
<RootStack.Screen name="SelectWallet" component={SelectWallet} />
<RootStack.Screen name="ReceiveDetailsRoot" component={ReceiveDetailsStackRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="LappBrowserRoot" component={LappBrowserStackRoot} options={NavigationDefaultOptions} />
<RootStack.Screen name="AOPPRoot" component={AOPPRoot} options={NavigationDefaultOptions} />
2021-09-30 13:33:50 +02:00
<RootStack.Screen name="LDKOpenChannelRoot" component={LDKOpenChannelRoot} options={NavigationDefaultOptions} />
2020-12-25 17:09:53 +01:00
<RootStack.Screen
name="ScanQRCodeRoot"
component={ScanQRCodeRoot}
options={{
headerShown: false,
stackPresentation: isDesktop ? 'containedModal' : 'fullScreenModal',
2020-12-25 17:09:53 +01:00
}}
/>
</RootStack.Navigator>
);
};
2020-05-27 13:12:17 +02:00
export default InitRoot;