BlueWallet/navigation/SendDetailsStack.tsx

89 lines
3.2 KiB
TypeScript
Raw Normal View History

2024-05-24 17:44:04 +02:00
import React, { useMemo } from 'react';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import navigationStyle, { CloseButtonPosition } from '../components/navigationStyle';
2024-05-20 11:54:13 +02:00
import { useTheme } from '../components/themes';
import loc from '../loc';
2024-05-09 03:04:52 +02:00
import {
2024-05-20 11:54:13 +02:00
CoinControlComponent,
2024-05-09 03:04:52 +02:00
ConfirmComponent,
CreateTransactionComponent,
2024-06-07 15:37:45 +02:00
PaymentCodesListComponent,
2024-05-09 03:04:52 +02:00
PsbtMultisigComponent,
PsbtMultisigQRCodeComponent,
2024-05-20 11:54:13 +02:00
PsbtWithHardwareWalletComponent,
2024-05-09 03:04:52 +02:00
SelectWalletComponent,
2024-05-20 11:54:13 +02:00
SendDetailsComponent,
SuccessComponent,
2024-05-09 03:04:52 +02:00
} from './LazyLoadSendDetailsStack';
2024-05-22 21:35:36 +02:00
import { SendDetailsStackParamList } from './SendDetailsStackParamList';
2024-05-24 17:44:04 +02:00
import HeaderRightButton from '../components/HeaderRightButton';
import { BitcoinUnit } from '../models/bitcoinUnits';
2024-05-09 03:04:52 +02:00
const Stack = createNativeStackNavigator<SendDetailsStackParamList>();
const SendDetailsStack = () => {
const theme = useTheme();
2024-06-02 23:52:49 +02:00
const DetailsButton = useMemo(
() => <HeaderRightButton testID="TransactionDetailsButton" disabled={true} title={loc.send.create_details} />,
[],
);
2024-05-09 03:04:52 +02:00
return (
<Stack.Navigator initialRouteName="SendDetails" screenOptions={{ headerShadowVisible: false }}>
<Stack.Screen
name="SendDetails"
component={SendDetailsComponent}
options={navigationStyle({
2024-05-09 03:04:52 +02:00
title: loc.send.header,
statusBarStyle: 'light',
closeButtonPosition: CloseButtonPosition.Left,
})(theme)}
initialParams={{ isEditable: true, feeUnit: BitcoinUnit.BTC, amountUnit: BitcoinUnit.BTC }} // Correctly typed now
2024-05-09 03:04:52 +02:00
/>
2024-05-24 17:44:04 +02:00
<Stack.Screen
name="Confirm"
component={ConfirmComponent}
options={navigationStyle({ title: loc.send.confirm_header, headerRight: () => DetailsButton })(theme)}
/>
2024-05-09 03:04:52 +02:00
<Stack.Screen
name="PsbtWithHardwareWallet"
component={PsbtWithHardwareWalletComponent}
options={navigationStyle({ title: loc.send.header, gestureEnabled: false, fullScreenGestureEnabled: false })(theme)}
/>
<Stack.Screen
name="CreateTransaction"
component={CreateTransactionComponent}
options={navigationStyle({ title: loc.send.create_details })(theme)}
/>
<Stack.Screen
name="PsbtMultisig"
component={PsbtMultisigComponent}
options={navigationStyle({ title: loc.multisig.header })(theme)}
/>
<Stack.Screen
name="PsbtMultisigQRCode"
component={PsbtMultisigQRCodeComponent}
options={navigationStyle({ title: loc.multisig.header })(theme)}
/>
<Stack.Screen
name="Success"
component={SuccessComponent}
options={navigationStyle({ headerShown: false, gestureEnabled: false })(theme)}
/>
<Stack.Screen
name="SelectWallet"
component={SelectWalletComponent}
options={navigationStyle({ title: loc.wallets.select_wallet })(theme)}
/>
<Stack.Screen name="CoinControl" component={CoinControlComponent} options={navigationStyle({ title: loc.cc.header })(theme)} />
2024-06-07 15:37:45 +02:00
<Stack.Screen
2024-06-07 20:50:50 +02:00
name="PaymentCodeList"
2024-06-07 15:37:45 +02:00
component={PaymentCodesListComponent}
options={navigationStyle({ title: loc.bip47.contacts })(theme)}
/>
2024-05-09 03:04:52 +02:00
</Stack.Navigator>
);
};
export default SendDetailsStack;