import React, { useCallback, useMemo } from 'react'; import { View } from 'react-native'; import { NativeStackNavigationOptions } from '@react-navigation/native-stack'; import { isDesktop } from '../blue_modules/environment'; import HeaderRightButton from '../components/HeaderRightButton'; import navigationStyle, { CloseButtonPosition } from '../components/navigationStyle'; import { useTheme } from '../components/themes'; import { useExtendedNavigation } from '../hooks/useExtendedNavigation'; import loc from '../loc'; 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 Broadcast from '../screen/send/Broadcast'; import IsItMyAddress from '../screen/settings/IsItMyAddress'; import Success from '../screen/send/success'; import CPFP from '../screen/transactions/CPFP'; import TransactionDetails from '../screen/transactions/TransactionDetails'; import RBFBumpFee from '../screen/transactions/RBFBumpFee'; import RBFCancel from '../screen/transactions/RBFCancel'; import TransactionStatus from '../screen/transactions/TransactionStatus'; import WalletAddresses from '../screen/wallets/WalletAddresses'; import WalletDetails from '../screen/wallets/WalletDetails'; import GenerateWord from '../screen/wallets/generateWord'; import SelectWallet from '../screen/wallets/SelectWallet'; import WalletsList from '../screen/wallets/WalletsList'; import { NavigationDefaultOptions, NavigationFormModalOptions, StatusBarLightOptions, DetailViewStack } from './index'; // Importing the navigator import AddWalletStack from './AddWalletStack'; import AztecoRedeemStackRoot from './AztecoRedeemStack'; import { AboutComponent, BlockExplorerSettingsComponent, CurrencyComponent, DefaultViewComponent, ElectrumSettingsComponent, EncryptStorageComponent, GeneralSettingsComponent, LanguageComponent, LicensingComponent, LightningSettingsComponent, NetworkSettingsComponent, NotificationSettingsComponent, PlausibleDeniabilityComponent, ReleaseNotesComponent, SelfTestComponent, SettingsComponent, SettingsPrivacyComponent, ToolsComponent, } from './LazyLoadSettingsStack'; import PaymentCodesListComponent from './LazyLoadPaymentCodeStack'; import LNDCreateInvoiceRoot from './LNDCreateInvoiceStack'; import ReceiveDetailsStackRoot from './ReceiveDetailsStack'; import ScanLndInvoiceRoot from './ScanLndInvoiceStack'; import ScanQRCodeStackRoot from './ScanQRCodeStack'; import SendDetailsStack from './SendDetailsStack'; import SignVerifyStackRoot from './SignVerifyStack'; import ViewEditMultisigCosignersStackRoot from './ViewEditMultisigCosignersStack'; import WalletExportStack from './WalletExportStack'; import WalletXpubStackRoot from './WalletXpubStack'; import SettingsButton from '../components/icons/SettingsButton'; import ExportMultisigCoordinationSetupStack from './ExportMultisigCoordinationSetupStack'; import ManageWallets from '../screen/wallets/ManageWallets'; import getWalletTransactionsOptions from './helpers/getWalletTransactionsOptions'; import { useSettings } from '../hooks/context/useSettings'; import { useStorage } from '../hooks/context/useStorage'; import WalletTransactions from '../screen/wallets/WalletTransactions'; import AddWalletButton from '../components/AddWalletButton'; const DetailViewStackScreensStack = () => { const theme = useTheme(); const navigation = useExtendedNavigation(); const { wallets } = useStorage(); const { isTotalBalanceEnabled } = useSettings(); const DetailButton = useMemo(() => , []); const navigateToAddWallet = useCallback(() => { navigation.navigate('AddWalletRoot'); }, [navigation]); const RightBarButtons = useMemo( () => ( <> ), [navigateToAddWallet], ); const useWalletListScreenOptions = useMemo(() => { const displayTitle = !isTotalBalanceEnabled || wallets.length <= 1; return { title: displayTitle ? loc.wallets.wallets : '', navigationBarColor: theme.colors.navigationBarColor, headerShown: !isDesktop, headerLargeTitle: displayTitle, headerShadowVisible: false, headerLargeTitleShadowVisible: false, headerStyle: { backgroundColor: theme.colors.customHeader, }, headerRight: () => RightBarButtons, }; }, [RightBarButtons, isTotalBalanceEnabled, theme.colors.customHeader, theme.colors.navigationBarColor, wallets.length]); const walletListScreenOptions = useWalletListScreenOptions; return ( DetailButton, headerBackTitleStyle: { fontSize: 0 }, headerBackTitleVisible: true, })(theme)} /> {/* screens */} ); }; export default DetailViewStackScreensStack; const styles = { width24: { width: 24, }, walletDetails: { justifyContent: 'center', alignItems: 'flex-end', }, };