Revert "REF: navigation styles"

This commit is contained in:
Overtorment 2020-12-04 13:39:47 +00:00
parent 7d4d92d9e4
commit 476ba022a0
67 changed files with 798 additions and 865 deletions

View File

@ -485,6 +485,90 @@ export const BlueAlertWalletExportReminder = ({ onSuccess = () => {}, onFailure
);
};
export const BlueNavigationStyle = (navigation, withNavigationCloseButton = false, customCloseButtonFunction = undefined) => {
let headerRight;
const { colors, closeImage } = useTheme();
if (withNavigationCloseButton) {
headerRight = () => (
<TouchableOpacity
style={{ width: 40, height: 40, padding: 14 }}
onPress={
customCloseButtonFunction === undefined
? () => {
Keyboard.dismiss();
navigation.goBack(null);
}
: customCloseButtonFunction
}
>
<Image style={{ alignSelf: 'center' }} source={closeImage} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
headerStyle: {
borderBottomWidth: 0,
elevation: 0,
shadowOpacity: 0,
shadowOffset: { height: 0, width: 0 },
},
headerTitleStyle: {
fontWeight: '600',
color: colors.foregroundColor,
},
headerRight,
headerBackTitleVisible: false,
headerTintColor: colors.foregroundColor,
};
};
export const BlueCreateTxNavigationStyle = (navigation, withAdvancedOptionsMenuButton = false, advancedOptionsMenuButtonAction) => {
const { colors, closeImage } = useTheme();
let headerRight;
if (withAdvancedOptionsMenuButton) {
headerRight = () => (
<TouchableOpacity
style={{ minWidth: 40, height: 40, justifyContent: 'center' }}
onPress={advancedOptionsMenuButtonAction}
testID="advancedOptionsMenuButton"
>
<Icon size={22} name="kebab-horizontal" type="octicon" color={colors.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
headerStyle: {
borderBottomWidth: 0,
elevation: 0,
shadowOffset: { height: 0, width: 0 },
},
headerTitleStyle: {
fontWeight: '600',
color: colors.foregroundColor,
},
headerTintColor: colors.foregroundColor,
headerLeft: () => (
<TouchableOpacity
style={{ minWidth: 40, height: 40, justifyContent: 'center', paddingHorizontal: 14 }}
onPress={() => {
Keyboard.dismiss();
navigation.goBack(null);
}}
>
<Image style={{}} source={closeImage} />
</TouchableOpacity>
),
headerRight,
headerBackTitle: null,
};
};
export const BluePrivateBalance = () => {
return Platform.select({
ios: (

View File

@ -2,7 +2,6 @@ import React from 'react';
import { createStackNavigator, TransitionPresets } from '@react-navigation/stack';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { Platform, useWindowDimensions, Dimensions } from 'react-native';
import { useTheme } from '@react-navigation/native';
import Settings from './screen/settings/settings';
import About from './screen/settings/about';
@ -108,191 +107,142 @@ const defaultStackScreenOptions =
};
const WalletsStack = createStackNavigator();
const WalletsRoot = () => {
const theme = useTheme();
return (
<WalletsStack.Navigator {...(Platform.OS === 'android' ? { screenOptions: defaultScreenOptions } : null)}>
<WalletsStack.Screen name="WalletsList" component={WalletsList} />
<WalletsStack.Screen name="WalletTransactions" component={WalletTransactions} options={WalletTransactions.navigationOptions(theme)} />
<WalletsStack.Screen name="WalletDetails" component={WalletDetails} options={WalletDetails.navigationOptions(theme)} />
<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)} />
<WalletsStack.Screen name="SettingsPrivacy" component={SettingsPrivacy} options={SettingsPrivacy.navigationOptions(theme)} />
<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="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,
}}
/>
</WalletsStack.Navigator>
);
};
const WalletsRoot = () => (
<WalletsStack.Navigator {...(Platform.OS === 'android' ? { screenOptions: defaultScreenOptions } : null)}>
<WalletsStack.Screen name="WalletsList" component={WalletsList} />
<WalletsStack.Screen name="WalletTransactions" component={WalletTransactions} options={WalletTransactions.navigationOptions} />
<WalletsStack.Screen name="WalletDetails" component={WalletDetails} options={WalletDetails.navigationOptions} />
<WalletsStack.Screen name="TransactionDetails" component={TransactionDetails} options={TransactionDetails.navigationOptions} />
<WalletsStack.Screen name="TransactionStatus" component={TransactionStatus} options={TransactionStatus.navigationOptions} />
<WalletsStack.Screen name="HodlHodl" component={HodlHodl} options={HodlHodl.navigationOptions} />
<WalletsStack.Screen name="CPFP" component={CPFP} options={CPFP.navigationOptions} />
<WalletsStack.Screen name="RBFBumpFee" component={RBFBumpFee} options={RBFBumpFee.navigationOptions} />
<WalletsStack.Screen name="RBFCancel" component={RBFCancel} options={RBFCancel.navigationOptions} />
<WalletsStack.Screen name="Settings" component={Settings} options={Settings.navigationOptions} />
<WalletsStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions} />
<WalletsStack.Screen name="Currency" component={Currency} options={Currency.navigationOptions} />
<WalletsStack.Screen name="About" component={About} options={About.navigationOptions} />
<WalletsStack.Screen name="ReleaseNotes" component={ReleaseNotes} options={ReleaseNotes.navigationOptions} />
<WalletsStack.Screen name="Selftest" component={Selftest} options={Selftest.navigationOptions} />
<WalletsStack.Screen name="Licensing" component={Licensing} options={Licensing.navigationOptions} />
<WalletsStack.Screen name="DefaultView" component={DefaultView} options={DefaultView.navigationOptions} />
<WalletsStack.Screen name="Language" component={Language} options={Language.navigationOptions} />
<WalletsStack.Screen name="EncryptStorage" component={EncryptStorage} options={EncryptStorage.navigationOptions} />
<WalletsStack.Screen name="GeneralSettings" component={GeneralSettings} options={GeneralSettings.navigationOptions} />
<WalletsStack.Screen name="NetworkSettings" component={NetworkSettings} options={NetworkSettings.navigationOptions} />
<WalletsStack.Screen name="NotificationSettings" component={NotificationSettings} options={NotificationSettings.navigationOptions} />
<WalletsStack.Screen name="PlausibleDeniability" component={PlausibleDeniability} options={PlausibleDeniability.navigationOptions} />
<WalletsStack.Screen name="LightningSettings" component={LightningSettings} options={LightningSettings.navigationOptions} />
<WalletsStack.Screen name="ElectrumSettings" component={ElectrumSettings} options={ElectrumSettings.navigationOptions} />
<WalletsStack.Screen name="SettingsPrivacy" component={SettingsPrivacy} options={SettingsPrivacy.navigationOptions} />
<WalletsStack.Screen name="LNDViewInvoice" component={LNDViewInvoice} options={LNDViewInvoice.navigationOptions} />
<WalletsStack.Screen
name="LNDViewAdditionalInvoiceInformation"
component={LNDViewAdditionalInvoiceInformation}
options={LNDViewAdditionalInvoiceInformation.navigationOptions}
/>
<WalletsStack.Screen
name="LNDViewAdditionalInvoicePreImage"
component={LNDViewAdditionalInvoicePreImage}
options={LNDViewAdditionalInvoicePreImage.navigationOptions}
/>
<WalletsStack.Screen name="HodlHodlViewOffer" component={HodlHodlViewOffer} options={HodlHodlViewOffer.navigationOptions} />
<WalletsStack.Screen name="Broadcast" component={Broadcast} options={Broadcast.navigationOptions} />
<WalletsStack.Screen name="LnurlPay" component={LnurlPay} options={LnurlPay.navigationOptions} />
<WalletsStack.Screen name="LnurlPaySuccess" component={LnurlPaySuccess} options={LnurlPaySuccess.navigationOptions} />
<WalletsStack.Screen
name="Success"
component={Success}
options={{
headerShown: false,
gestureEnabled: false,
}}
/>
</WalletsStack.Navigator>
);
const AddWalletStack = createStackNavigator();
const AddWalletRoot = () => {
const theme = useTheme();
return (
<AddWalletStack.Navigator screenOptions={defaultStackScreenOptions}>
<AddWalletStack.Screen name="AddWallet" component={AddWallet} options={AddWallet.navigationOptions(theme)} />
<AddWalletStack.Screen name="ImportWallet" component={ImportWallet} options={ImportWallet.navigationOptions(theme)} />
<AddWalletStack.Screen name="PleaseBackup" component={PleaseBackup} options={PleaseBackup.navigationOptions(theme)} />
<AddWalletStack.Screen
name="PleaseBackupLNDHub"
component={PleaseBackupLNDHub}
options={PleaseBackupLNDHub.navigationOptions(theme)}
/>
<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.Navigator>
);
};
const AddWalletRoot = () => (
<AddWalletStack.Navigator screenOptions={defaultStackScreenOptions}>
<AddWalletStack.Screen name="AddWallet" component={AddWallet} options={AddWallet.navigationOptions} />
<AddWalletStack.Screen name="ImportWallet" component={ImportWallet} options={ImportWallet.navigationOptions} />
<AddWalletStack.Screen name="PleaseBackup" component={PleaseBackup} options={PleaseBackup.navigationOptions} />
<AddWalletStack.Screen name="PleaseBackupLNDHub" component={PleaseBackupLNDHub} options={PleaseBackupLNDHub.navigationOptions} />
<AddWalletStack.Screen name="ProvideEntropy" component={ProvideEntropy} options={ProvideEntropy.navigationOptions} />
<AddWalletStack.Screen name="WalletsAddMultisig" component={WalletsAddMultisig} options={WalletsAddMultisig.navigationOptions} />
<AddWalletStack.Screen
name="WalletsAddMultisigStep2"
component={WalletsAddMultisigStep2}
options={WalletsAddMultisigStep2.navigationOptions}
/>
</AddWalletStack.Navigator>
);
// CreateTransactionStackNavigator === SendDetailsStack
const SendDetailsStack = createStackNavigator();
const SendDetailsRoot = () => {
const theme = useTheme();
return (
<SendDetailsStack.Navigator screenOptions={defaultStackScreenOptions}>
<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>
);
};
const SendDetailsRoot = () => (
<SendDetailsStack.Navigator screenOptions={defaultStackScreenOptions}>
<SendDetailsStack.Screen name="SendDetails" component={SendDetails} options={SendDetails.navigationOptions} />
<SendDetailsStack.Screen name="Confirm" component={Confirm} options={Confirm.navigationOptions} />
<SendDetailsStack.Screen
name="PsbtWithHardwareWallet"
component={PsbtWithHardwareWallet}
options={PsbtWithHardwareWallet.navigationOptions}
/>
<SendDetailsStack.Screen name="CreateTransaction" component={SendCreate} options={SendCreate.navigationOptions} />
<SendDetailsStack.Screen name="PsbtMultisig" component={PsbtMultisig} options={PsbtMultisig.navigationOptions} />
<SendDetailsStack.Screen name="PsbtMultisigQRCode" component={PsbtMultisigQRCode} options={PsbtMultisigQRCode.navigationOptions} />
<SendDetailsStack.Screen
name="Success"
component={Success}
options={{
headerShown: false,
gestureEnabled: false,
}}
/>
<SendDetailsStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions} />
<SendDetailsStack.Screen name="CoinControl" component={CoinControl} options={CoinControl.navigationOptions} />
</SendDetailsStack.Navigator>
);
const LNDCreateInvoiceStack = createStackNavigator();
const LNDCreateInvoiceRoot = () => {
const theme = useTheme();
return (
<LNDCreateInvoiceStack.Navigator screenOptions={defaultStackScreenOptions}>
<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>
);
};
const LNDCreateInvoiceRoot = () => (
<LNDCreateInvoiceStack.Navigator screenOptions={defaultStackScreenOptions}>
<LNDCreateInvoiceStack.Screen name="LNDCreateInvoice" component={LNDCreateInvoice} options={LNDCreateInvoice.navigationOptions} />
<LNDCreateInvoiceStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions} />
<LNDCreateInvoiceStack.Screen name="LNDViewInvoice" component={LNDViewInvoice} options={LNDViewInvoice.navigationOptions} />
<LNDCreateInvoiceStack.Screen
name="LNDViewAdditionalInvoiceInformation"
component={LNDViewAdditionalInvoiceInformation}
options={LNDViewAdditionalInvoiceInformation.navigationOptions}
/>
<LNDCreateInvoiceStack.Screen
name="LNDViewAdditionalInvoicePreImage"
component={LNDViewAdditionalInvoicePreImage}
options={LNDViewAdditionalInvoicePreImage.navigationOptions}
/>
</LNDCreateInvoiceStack.Navigator>
);
// LightningScanInvoiceStackNavigator === ScanLndInvoiceStack
const ScanLndInvoiceStack = createStackNavigator();
const ScanLndInvoiceRoot = () => {
const theme = useTheme();
return (
<ScanLndInvoiceStack.Navigator screenOptions={defaultStackScreenOptions}>
<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>
);
};
const ScanLndInvoiceRoot = () => (
<ScanLndInvoiceStack.Navigator screenOptions={defaultStackScreenOptions}>
<ScanLndInvoiceStack.Screen name="ScanLndInvoice" component={ScanLndInvoice} options={ScanLndInvoice.navigationOptions} />
<ScanLndInvoiceStack.Screen name="SelectWallet" component={SelectWallet} options={SelectWallet.navigationOptions} />
<ScanLndInvoiceStack.Screen name="Success" component={Success} options={{ headerShown: false, gestureEnabled: false }} />
<ScanLndInvoiceStack.Screen name="LnurlPay" component={LnurlPay} options={LnurlPay.navigationOptions} />
<ScanLndInvoiceStack.Screen name="LnurlPaySuccess" component={LnurlPaySuccess} options={LnurlPaySuccess.navigationOptions} />
</ScanLndInvoiceStack.Navigator>
);
const AztecoRedeemStack = createStackNavigator();
const AztecoRedeemRoot = () => {
const theme = useTheme();
return (
<AztecoRedeemStack.Navigator screenOptions={defaultStackScreenOptions}>
<AztecoRedeemStack.Screen name="AztecoRedeem" component={AztecoRedeem} options={AztecoRedeem.navigationOptions(theme)} />
<AztecoRedeemStack.Screen name="SelectWallet" component={SelectWallet} options={{ headerLeft: null }} />
</AztecoRedeemStack.Navigator>
);
};
const AztecoRedeemRoot = () => (
<AztecoRedeemStack.Navigator screenOptions={defaultStackScreenOptions}>
<AztecoRedeemStack.Screen name="AztecoRedeem" component={AztecoRedeem} options={AztecoRedeem.navigationOptions} />
<AztecoRedeemStack.Screen name="SelectWallet" component={SelectWallet} options={{ headerLeft: null }} />
</AztecoRedeemStack.Navigator>
);
const ScanQRCodeStack = createStackNavigator();
const ScanQRCodeRoot = () => (
@ -316,26 +266,18 @@ const UnlockWithScreenRoot = () => (
);
const HodlHodlLoginStack = createStackNavigator();
const HodlHodlLoginRoot = () => {
const theme = useTheme();
return (
<HodlHodlLoginStack.Navigator name="HodlHodlLoginRoot" screenOptions={defaultStackScreenOptions}>
<HodlHodlLoginStack.Screen name="HodlHodlLogin" component={HodlHodlLogin} options={HodlHodlLogin.navigationOptions(theme)} />
</HodlHodlLoginStack.Navigator>
);
};
const HodlHodlLoginRoot = () => (
<HodlHodlLoginStack.Navigator name="HodlHodlLoginRoot" screenOptions={defaultStackScreenOptions}>
<HodlHodlLoginStack.Screen name="HodlHodlLogin" component={HodlHodlLogin} options={HodlHodlLogin.navigationOptions} />
</HodlHodlLoginStack.Navigator>
);
const ReorderWalletsStack = createStackNavigator();
const ReorderWalletsStackRoot = () => {
const theme = useTheme();
return (
<ReorderWalletsStack.Navigator name="ReorderWalletsRoot" screenOptions={defaultStackScreenOptions}>
<ReorderWalletsStack.Screen name="ReorderWallets" component={ReorderWallets} options={ReorderWallets.navigationOptions(theme)} />
</ReorderWalletsStack.Navigator>
);
};
const ReorderWalletsStackRoot = () => (
<ReorderWalletsStack.Navigator name="ReorderWalletsRoot" screenOptions={defaultStackScreenOptions}>
<ReorderWalletsStack.Screen name="ReorderWallets" component={ReorderWallets} options={ReorderWallets.navigationOptions} />
</ReorderWalletsStack.Navigator>
);
const Drawer = createDrawerNavigator();
function DrawerRoot() {
@ -355,48 +297,32 @@ function DrawerRoot() {
}
const ReceiveDetailsStack = createStackNavigator();
const ReceiveDetailsStackRoot = () => {
const theme = useTheme();
return (
<ReceiveDetailsStack.Navigator name="ReceiveDetailsRoot" screenOptions={defaultStackScreenOptions} initialRouteName="ReceiveDetails">
<RootStack.Screen name="ReceiveDetails" component={ReceiveDetails} options={ReceiveDetails.navigationOptions(theme)} />
</ReceiveDetailsStack.Navigator>
);
};
const ReceiveDetailsStackRoot = () => (
<ReceiveDetailsStack.Navigator name="ReceiveDetailsRoot" screenOptions={defaultStackScreenOptions} initialRouteName="ReceiveDetails">
<RootStack.Screen name="ReceiveDetails" component={ReceiveDetails} options={ReceiveDetails.navigationOptions} />
</ReceiveDetailsStack.Navigator>
);
const WalletXpubStack = createStackNavigator();
const WalletXpubStackRoot = () => {
const theme = useTheme();
return (
<WalletXpubStack.Navigator name="WalletXpubRoot" screenOptions={defaultStackScreenOptions} initialRouteName="WalletXpub">
<WalletXpubStack.Screen name="WalletXpub" component={WalletXpub} options={WalletXpub.navigationOptions(theme)} />
</WalletXpubStack.Navigator>
);
};
const WalletXpubStackRoot = () => (
<WalletXpubStack.Navigator name="WalletXpubRoot" screenOptions={defaultStackScreenOptions} initialRouteName="WalletXpub">
<WalletXpubStack.Screen name="WalletXpub" component={WalletXpub} options={WalletXpub.navigationOptions} />
</WalletXpubStack.Navigator>
);
const WalletExportStack = createStackNavigator();
const WalletExportStackRoot = () => {
const theme = useTheme();
return (
<WalletExportStack.Navigator name="WalletExportRoot" screenOptions={defaultStackScreenOptions} initialRouteName="WalletExport">
<WalletExportStack.Screen name="WalletExport" component={WalletExport} options={WalletExport.navigationOptions(theme)} />
</WalletExportStack.Navigator>
);
};
const WalletExportStackRoot = () => (
<WalletExportStack.Navigator name="WalletExportRoot" screenOptions={defaultStackScreenOptions} initialRouteName="WalletExport">
<WalletExportStack.Screen name="WalletExport" component={WalletExport} options={WalletExport.navigationOptions} />
</WalletExportStack.Navigator>
);
const LappBrowserStack = createStackNavigator();
const LappBrowserStackRoot = () => {
const theme = useTheme();
return (
<LappBrowserStack.Navigator name="LappBrowserRoot" screenOptions={defaultStackScreenOptions} initialRouteName="LappBrowser">
<LappBrowserStack.Screen name="LappBrowser" component={LappBrowser} options={LappBrowser.navigationOptions(theme)} />
</LappBrowserStack.Navigator>
);
};
const LappBrowserStackRoot = () => (
<LappBrowserStack.Navigator name="LappBrowserRoot" screenOptions={defaultStackScreenOptions} initialRouteName="LappBrowser">
<LappBrowserStack.Screen name="LappBrowser" component={LappBrowser} options={LappBrowser.navigationOptions} />
</LappBrowserStack.Navigator>
);
const InitStack = createStackNavigator();
const InitRoot = () => (
@ -413,51 +339,47 @@ const InitRoot = () => (
);
const RootStack = createStackNavigator();
const Navigation = () => {
const theme = useTheme();
const Navigation = () => (
<RootStack.Navigator mode="modal" screenOptions={defaultScreenOptions} initialRouteName="LoadingScreenRoot">
{/* stacks */}
<RootStack.Screen name="WalletsRoot" component={WalletsRoot} options={{ headerShown: false }} />
<RootStack.Screen name="AddWalletRoot" component={AddWalletRoot} options={{ headerShown: false }} />
<RootStack.Screen name="SendDetailsRoot" component={SendDetailsRoot} options={{ headerShown: false }} />
<RootStack.Screen name="LNDCreateInvoiceRoot" component={LNDCreateInvoiceRoot} options={{ headerShown: false }} />
<RootStack.Screen name="ScanLndInvoiceRoot" component={ScanLndInvoiceRoot} options={{ headerShown: false }} />
<RootStack.Screen name="AztecoRedeemRoot" component={AztecoRedeemRoot} options={{ headerShown: false }} />
<RootStack.Screen name="HodlHodlLoginRoot" component={HodlHodlLoginRoot} options={{ headerShown: false }} />
<RootStack.Screen name="HodlHodlMyContracts" component={HodlHodlMyContracts} options={HodlHodlMyContracts.navigationOptions} />
<RootStack.Screen name="HodlHodlWebview" component={HodlHodlWebview} options={HodlHodlWebview.navigationOptions} />
return (
<RootStack.Navigator mode="modal" screenOptions={defaultScreenOptions} initialRouteName="LoadingScreenRoot">
{/* stacks */}
<RootStack.Screen name="WalletsRoot" component={WalletsRoot} options={{ headerShown: false }} />
<RootStack.Screen name="AddWalletRoot" component={AddWalletRoot} options={{ headerShown: false }} />
<RootStack.Screen name="SendDetailsRoot" component={SendDetailsRoot} options={{ headerShown: false }} />
<RootStack.Screen name="LNDCreateInvoiceRoot" component={LNDCreateInvoiceRoot} options={{ headerShown: false }} />
<RootStack.Screen name="ScanLndInvoiceRoot" component={ScanLndInvoiceRoot} options={{ headerShown: false }} />
<RootStack.Screen name="AztecoRedeemRoot" component={AztecoRedeemRoot} options={{ headerShown: false }} />
<RootStack.Screen name="HodlHodlLoginRoot" component={HodlHodlLoginRoot} options={{ headerShown: false }} />
<RootStack.Screen name="HodlHodlMyContracts" component={HodlHodlMyContracts} options={HodlHodlMyContracts.navigationOptions(theme)} />
<RootStack.Screen name="HodlHodlWebview" component={HodlHodlWebview} options={HodlHodlWebview.navigationOptions(theme)} />
{/* screens */}
<RootStack.Screen name="WalletExportRoot" component={WalletExportStackRoot} options={{ headerShown: false }} />
<RootStack.Screen
name="ExportMultisigCoordinationSetup"
component={ExportMultisigCoordinationSetup}
options={ExportMultisigCoordinationSetup.navigationOptions}
/>
<RootStack.Screen
name="ViewEditMultisigCosigners"
component={ViewEditMultisigCosigners}
options={ViewEditMultisigCosigners.navigationOptions}
/>
<RootStack.Screen name="WalletXpubRoot" component={WalletXpubStackRoot} options={{ headerShown: false }} />
<RootStack.Screen name="BuyBitcoin" component={BuyBitcoin} options={BuyBitcoin.navigationOptions} />
<RootStack.Screen name="Marketplace" component={Marketplace} options={Marketplace.navigationOptions} />
<RootStack.Screen name="SelectWallet" component={SelectWallet} options={{ headerLeft: null }} />
<RootStack.Screen name="ReceiveDetailsRoot" component={ReceiveDetailsStackRoot} options={{ headerShown: false }} />
<RootStack.Screen name="LappBrowserRoot" component={LappBrowserStackRoot} options={{ headerShown: false }} />
{/* screens */}
<RootStack.Screen name="WalletExportRoot" component={WalletExportStackRoot} options={{ headerShown: false }} />
<RootStack.Screen
name="ExportMultisigCoordinationSetup"
component={ExportMultisigCoordinationSetup}
options={ExportMultisigCoordinationSetup.navigationOptions(theme)}
/>
<RootStack.Screen
name="ViewEditMultisigCosigners"
component={ViewEditMultisigCosigners}
options={ViewEditMultisigCosigners.navigationOptions(theme)}
/>
<RootStack.Screen name="WalletXpubRoot" component={WalletXpubStackRoot} options={{ headerShown: false }} />
<RootStack.Screen name="BuyBitcoin" component={BuyBitcoin} options={BuyBitcoin.navigationOptions(theme)} />
<RootStack.Screen name="Marketplace" component={Marketplace} options={Marketplace.navigationOptions(theme)} />
<RootStack.Screen name="SelectWallet" component={SelectWallet} options={{ headerLeft: null }} />
<RootStack.Screen name="ReceiveDetailsRoot" component={ReceiveDetailsStackRoot} options={{ headerShown: false }} />
<RootStack.Screen name="LappBrowserRoot" component={LappBrowserStackRoot} options={{ headerShown: false }} />
<RootStack.Screen
name="ScanQRCodeRoot"
component={ScanQRCodeRoot}
options={{
...(Platform.OS === 'ios' ? TransitionPresets.ModalTransition : TransitionPresets.ScaleFromCenterAndroid),
headerShown: false,
}}
/>
</RootStack.Navigator>
);
};
<RootStack.Screen
name="ScanQRCodeRoot"
component={ScanQRCodeRoot}
options={{
...(Platform.OS === 'ios' ? TransitionPresets.ModalTransition : TransitionPresets.ScaleFromCenterAndroid),
headerShown: false,
}}
/>
</RootStack.Navigator>
);
export default InitRoot;

View File

@ -1,92 +0,0 @@
import React from 'react';
import { Image, Keyboard, TouchableOpacity, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
button: {
minWidth: 40,
height: 40,
justifyContent: 'center',
paddingHorizontal: 14,
},
});
const navigationStyle = ({ closeButton = false, closeButtonFunc, ...opts }, formatter) => {
return theme => ({ navigation, route }) => {
let headerRight = null;
if (closeButton) {
const handleClose = closeButtonFunc
? () => closeButtonFunc({ navigation, route })
: () => {
Keyboard.dismiss();
navigation.goBack(null);
};
headerRight = () => (
<TouchableOpacity style={styles.button} onPress={handleClose}>
<Image source={theme.closeImage} />
</TouchableOpacity>
);
}
let options = {
headerStyle: {
borderBottomWidth: 0,
elevation: 0,
shadowOpacity: 0,
shadowOffset: { height: 0, width: 0 },
},
headerTitleStyle: {
fontWeight: '600',
color: theme.colors.foregroundColor,
},
headerRight,
headerBackTitleVisible: false,
headerTintColor: theme.colors.foregroundColor,
...opts,
};
if (formatter) {
options = formatter(options, { theme, navigation, route });
}
return options;
};
};
export default navigationStyle;
export const navigationStyleTx = (opts, formatter) => {
return theme => ({ navigation, route }) => {
let options = {
headerStyle: {
borderBottomWidth: 0,
elevation: 0,
shadowOffset: { height: 0, width: 0 },
},
headerTitleStyle: {
fontWeight: '600',
color: theme.colors.foregroundColor,
},
// headerBackTitle: null,
headerBackTitleVisible: false,
headerTintColor: theme.colors.foregroundColor,
headerLeft: () => (
<TouchableOpacity
style={styles.button}
onPress={() => {
Keyboard.dismiss();
navigation.goBack(null);
}}
>
<Image source={theme.closeImage} />
</TouchableOpacity>
),
...opts,
};
if (formatter) {
options = formatter(options, { theme, navigation, route });
}
return options;
};
};

View File

@ -75,7 +75,6 @@
"item_rating": "{rating} trades",
"item_rating_no": "No rating",
"login": "Login",
"logout": "logout",
"mycont": "My contracts",
"offer_accept": "Accept offer",
"offer_account_finish": "Looks like you didn't finish setting up account on HodlHodl, would you like to finish setup now?",
@ -146,8 +145,6 @@
"header": "Receive"
},
"send": {
"broadcast_success_screen_msg": "Success! You transaction has been broadcasted!",
"broadcast_success_screen_open": "Open link in explorer",
"broadcastButton": "BROADCAST",
"broadcastError": "error",
"broadcastNone": "Input transaction hash",

View File

@ -1,6 +1,4 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Ionicons from 'react-native-vector-icons/Ionicons';
import {
TouchableOpacity,
ActivityIndicator,
@ -14,9 +12,9 @@ import {
StyleSheet,
} from 'react-native';
import { WebView } from 'react-native-webview';
import { SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import Ionicons from 'react-native-vector-icons/Ionicons';
import PropTypes from 'prop-types';
import Notifications from '../../blue_modules/notifications';
let processedInvoices = {};
@ -519,8 +517,8 @@ Browser.propTypes = {
}),
};
Browser.navigationOptions = navigationStyle({
closeButton: true,
Browser.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: 'Lapp Browser',
headerLeft: null,
});

View File

@ -2,30 +2,34 @@
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
import {
ActivityIndicator,
Image,
Keyboard,
KeyboardAvoidingView,
StatusBar,
StyleSheet,
Text,
TextInput,
TouchableOpacity,
TouchableWithoutFeedback,
View,
TextInput,
KeyboardAvoidingView,
Keyboard,
StatusBar,
TouchableWithoutFeedback,
TouchableOpacity,
Text,
StyleSheet,
Image,
} from 'react-native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueAlertWalletExportReminder, BlueBitcoinAmount, BlueButton, BlueDismissKeyboardInputAccessory } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import {
BlueNavigationStyle,
BlueButton,
BlueBitcoinAmount,
BlueDismissKeyboardInputAccessory,
BlueAlertWalletExportReminder,
} from '../../BlueComponents';
import * as NavigationService from '../../NavigationService';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
import loc, { formatBalanceWithoutSuffix, formatBalancePlain } from '../../loc';
import Lnurl from '../../class/lnurl';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import Notifications from '../../blue_modules/notifications';
import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-navigation/native';
const currency = require('../../blue_modules/currency');
const LNDCreateInvoice = () => {
@ -486,8 +490,8 @@ const styles = StyleSheet.create({
export default LNDCreateInvoice;
LNDCreateInvoice.navigationOptions = navigationStyle({
closeButton: true,
LNDCreateInvoice.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
headerTitle: loc.receive.header,
headerLeft: null,
});

View File

@ -1,15 +1,22 @@
/* global alert */
import React, { useContext, useEffect, useState } from 'react';
import { View, Share, StyleSheet } from 'react-native';
import {
BlueLoading,
BlueCopyTextToClipboard,
SafeBlueArea,
BlueButton,
BlueNavigationStyle,
BlueText,
BlueSpacing20,
} from '../../BlueComponents';
import QRCode from 'react-native-qrcode-svg';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueButton, BlueCopyTextToClipboard, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const LNDViewAdditionalInvoiceInformation = () => {
// state = { walletInfo: undefined };
const { walletID } = useRoute().params;
const { wallets } = useContext(BlueStorageContext);
const wallet = wallets.find(w => w.getID() === walletID);
@ -116,6 +123,7 @@ const styles = StyleSheet.create({
export default LNDViewAdditionalInvoiceInformation;
LNDViewAdditionalInvoiceInformation.navigationOptions = navigationStyle({
LNDViewAdditionalInvoiceInformation.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.lndViewInvoice.additional_info,
});

View File

@ -1,11 +1,9 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { BlueCopyTextToClipboard, SafeBlueArea, BlueNavigationStyle, BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import QRCode from 'react-native-qrcode-svg';
import { useRoute, useTheme } from '@react-navigation/native';
import { BlueCopyTextToClipboard, SafeBlueArea, BlueSpacing20, BlueTextCentered } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
import { useRoute, useTheme } from '@react-navigation/native';
const LNDViewAdditionalInvoicePreImage = () => {
// state = { walletInfo: undefined };
@ -61,6 +59,7 @@ const styles = StyleSheet.create({
export default LNDViewAdditionalInvoicePreImage;
LNDViewAdditionalInvoicePreImage.navigationOptions = navigationStyle({
LNDViewAdditionalInvoicePreImage.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.lndViewInvoice.additional_info,
});

View File

@ -1,11 +1,6 @@
import React, { useContext, useEffect, useRef, useState } from 'react';
import { View, Text, StatusBar, ScrollView, BackHandler, TouchableOpacity, StyleSheet, useWindowDimensions } from 'react-native';
import Share from 'react-native-share';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
import QRCode from 'react-native-qrcode-svg';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import {
BlueLoading,
BlueText,
@ -13,12 +8,16 @@ import {
BlueButton,
SecondButton,
BlueCopyTextToClipboard,
BlueNavigationStyle,
BlueSpacing20,
BlueTextCentered,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { Icon } from 'react-native-elements';
import QRCode from 'react-native-qrcode-svg';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { SuccessView } from '../send/success';
@ -357,22 +356,23 @@ const styles = StyleSheet.create({
},
});
LNDViewInvoice.navigationOptions = navigationStyle(
{
title: loc.lndViewInvoice.lightning_invoice,
closeButton: true,
closeButtonFunc: ({ navigation }) => navigation.dangerouslyGetParent().pop(),
},
(options, { theme, navigation, route }) => {
return route.params.isModal === true
? {
headerLeft: null,
gestureEnabled: false,
}
: {
headerRight: null,
};
},
);
export default LNDViewInvoice;
LNDViewInvoice.navigationOptions = ({ navigation, route }) =>
route.params.isModal === true
? {
...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().pop()),
title: loc.lndViewInvoice.lightning_invoice,
headerLeft: null,
headerStyle: {
...BlueNavigationStyle().headerStyle,
},
gestureEnabled: false,
}
: {
...BlueNavigationStyle(),
title: loc.lndViewInvoice.lightning_invoice,
headerStyle: {
...BlueNavigationStyle().headerStyle,
},
};

View File

@ -1,27 +1,26 @@
/* global alert */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import AsyncStorage from '@react-native-community/async-storage';
import { Image, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { Icon } from 'react-native-elements';
import navigationStyle from '../../components/navigationStyle';
import {
BlueBitcoinAmount,
BlueButton,
BlueCard,
BlueDismissKeyboardInputAccessory,
BlueLoading,
BlueNavigationStyle,
BlueSpacing20,
BlueText,
SafeBlueArea,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import Lnurl from '../../class/lnurl';
import { Image, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { Icon } from 'react-native-elements';
import Biometric from '../../class/biometrics';
import PropTypes from 'prop-types';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const currency = require('../../blue_modules/currency');
@ -261,9 +260,10 @@ const styles = StyleSheet.create({
},
});
LnurlPay.navigationOptions = navigationStyle({
title: '',
closeButton: true,
closeButtonFunc: ({ navigation }) => navigation.dangerouslyGetParent().popToTop(),
headerLeft: null,
});
LnurlPay.navigationOptions = ({ navigation, route }) => {
return {
...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().popToTop()),
title: '',
headerLeft: null,
};
};

View File

@ -1,12 +1,19 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import LottieView from 'lottie-react-native';
import { View, Text, Linking, StyleSheet, Image, ScrollView } from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import { Icon } from 'react-native-elements';
import { BlueButton, BlueButtonLink, BlueCard, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import {
BlueButton,
BlueButtonLink,
BlueNavigationStyle,
SafeBlueArea,
BlueCard,
BlueLoading,
BlueText,
BlueSpacing20,
} from '../../BlueComponents';
import PropTypes from 'prop-types';
import Lnurl from '../../class/lnurl';
import loc from '../../loc';
@ -194,9 +201,10 @@ const styles = StyleSheet.create({
},
});
LnurlPaySuccess.navigationOptions = navigationStyle({
title: '',
closeButton: true,
closeButtonFunc: ({ navigation }) => navigation.dangerouslyGetParent().popToTop(),
headerLeft: null,
});
LnurlPaySuccess.navigationOptions = ({ navigation, route }) => {
return {
...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().popToTop()),
title: '',
headerLeft: null,
};
};

View File

@ -12,22 +12,21 @@ import {
StyleSheet,
} from 'react-native';
import PropTypes from 'prop-types';
import { Icon } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import {
BlueButton,
SafeBlueArea,
BlueCard,
BlueDismissKeyboardInputAccessory,
BlueNavigationStyle,
BlueAddressInput,
BlueBitcoinAmount,
BlueLoading,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import Lnurl from '../../class/lnurl';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
@ -469,8 +468,8 @@ ScanLndInvoice.propTypes = {
}),
};
ScanLndInvoice.navigationOptions = navigationStyle({
closeButton: true,
ScanLndInvoice.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.send.header,
headerLeft: null,
});

View File

@ -1,13 +1,11 @@
/* global alert */
import React, { useContext, useState } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { useNavigation, useTheme } from '@react-navigation/native';
import { BlueLoading, BlueButton, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueSpacing20 } from '../BlueComponents';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import navigationStyle from '../components/navigationStyle';
import { BlueLoading, BlueButton, SafeBlueArea, BlueCard, BlueText, BlueSpacing20 } from '../BlueComponents';
import loc from '../loc';
import { BlueStorageContext } from '../blue_modules/storage-context';
import { useNavigation, useTheme } from '@react-navigation/native';
const prompt = require('../blue_modules/prompt');
const styles = StyleSheet.create({
@ -87,6 +85,7 @@ const PlausibleDeniability = () => {
export default PlausibleDeniability;
PlausibleDeniability.navigationOptions = navigationStyle({
PlausibleDeniability.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.plausibledeniability.title,
});

View File

@ -3,9 +3,8 @@ import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Keyboard, Text, TouchableOpacity, StatusBar, TouchableWithoutFeedback, View, StyleSheet } from 'react-native';
import { Icon } from 'react-native-elements';
import { BlueButton, BlueCreateTxNavigationStyle, BlueLoading, BlueSpacing, BlueText } from '../../BlueComponents';
import { BlueButton, BlueLoading, BlueSpacing, BlueText } from '../../BlueComponents';
import { navigationStyleTx } from '../../components/navigationStyle';
import loc from '../../loc';
import { PlaceholderWallet } from '../../class';
import Azteco from '../../class/azteco';
@ -184,6 +183,7 @@ AztecoRedeem.propTypes = {
}),
};
AztecoRedeem.navigationOptions = navigationStyleTx({
AztecoRedeem.navigationOptions = ({ navigation }) => ({
...BlueCreateTxNavigationStyle(navigation),
title: loc.azteco.title,
});

View File

@ -26,8 +26,8 @@ import {
BlueText,
BlueSpacing20,
BlueAlertWalletExportReminder,
BlueNavigationStyle,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import BottomModal from '../../components/BottomModal';
import Privacy from '../../Privacy';
import { Chain, BitcoinUnit } from '../../models/bitcoinUnits';
@ -350,8 +350,8 @@ const ReceiveDetails = () => {
);
};
ReceiveDetails.navigationOptions = navigationStyle({
closeButton: true,
ReceiveDetails.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.receive.header,
headerLeft: null,
});

View File

@ -1,8 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ScrollView, View, StyleSheet } from 'react-native';
import { BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueLoading } from '../BlueComponents';
import navigationStyle from '../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueLoading } from '../BlueComponents';
import PropTypes from 'prop-types';
import { SegwitP2SHWallet, LegacyWallet, HDSegwitP2SHWallet, HDSegwitBech32Wallet } from '../class';
import { BlueCurrentTheme } from '../components/themes';
const bitcoin = require('bitcoinjs-lib');
@ -260,6 +259,7 @@ Selftest.propTypes = {
}),
};
Selftest.navigationOptions = navigationStyle({
Selftest.navigationOptions = () => ({
...BlueNavigationStyle(),
title: 'Self test',
});

View File

@ -330,4 +330,8 @@ const ScanQRCode = () => {
);
};
ScanQRCode.navigationOptions = {
headerShown: false,
};
export default ScanQRCode;

View File

@ -2,10 +2,8 @@ import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, Linking, StyleSheet, View, KeyboardAvoidingView, Platform, Text, TextInput } from 'react-native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import loc from '../../loc';
import { HDSegwitBech32Wallet } from '../../class';
import navigationStyle from '../../components/navigationStyle';
import {
SafeBlueArea,
BlueCard,
@ -15,6 +13,7 @@ import {
BlueFormLabel,
BlueTextCentered,
BlueBigCheckmark,
BlueNavigationStyle,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import BlueElectrum from '../../blue_modules/BlueElectrum';
@ -111,7 +110,8 @@ const Broadcast = () => {
};
export default Broadcast;
Broadcast.navigationOptions = navigationStyle({
Broadcast.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.send.create_broadcast,
});
@ -180,10 +180,10 @@ function SuccessScreen({ tx }) {
<View style={styles.broadcastResultWrapper}>
<BlueBigCheckmark />
<BlueSpacing20 />
<BlueTextCentered>{loc.send.broadcast_success_screen_msg}</BlueTextCentered>
<BlueTextCentered>Success! You transaction has been broadcasted!</BlueTextCentered>
<BlueSpacing10 />
<Text style={styles.link} onPress={() => Linking.openURL(`https://blockstream.info/tx/${tx}`)}>
{loc.send.broadcast_success_screen_open}
Open link in explorer
</Text>
</View>
</BlueCard>

View File

@ -18,8 +18,7 @@ import { useRoute, useTheme, useNavigation } from '@react-navigation/native';
import loc, { formatBalance } from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { SafeBlueArea, BlueSpacing10, BlueSpacing20, BlueButton, BlueListItem } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueNavigationStyle, SafeBlueArea, BlueSpacing10, BlueSpacing20, BlueButton, BlueListItem } from '../../BlueComponents';
import BottomModal from '../../components/BottomModal';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -309,7 +308,8 @@ const styles = StyleSheet.create({
},
});
CoinControl.navigationOptions = navigationStyle({
CoinControl.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.cc.header,
});

View File

@ -1,15 +1,13 @@
/* global alert */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, FlatList, TouchableOpacity, StyleSheet, Switch, View } from 'react-native';
import { Text } from 'react-native-elements';
import { PayjoinClient } from 'payjoin-client';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import PayjoinTransaction from '../../class/payjoin-transaction';
import { BlueButton, BlueText, SafeBlueArea, BlueCard, BlueSpacing40 } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueText, SafeBlueArea, BlueCard, BlueSpacing40, BlueNavigationStyle } from '../../BlueComponents';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import PropTypes from 'prop-types';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Biometric from '../../class/biometrics';
import loc, { formatBalance, formatBalanceWithoutSuffix } from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
@ -326,6 +324,7 @@ Confirm.propTypes = {
}),
};
Confirm.navigationOptions = navigationStyle({
Confirm.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.send.confirm_header,
});

View File

@ -20,14 +20,13 @@ import Clipboard from '@react-native-community/clipboard';
import { Icon } from 'react-native-elements';
import Share from 'react-native-share';
import RNFS from 'react-native-fs';
import isCatalyst from 'react-native-is-catalyst';
import { SafeBlueArea, BlueCard, BlueText } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueNavigationStyle, SafeBlueArea, BlueCard, BlueText } from '../../BlueComponents';
import Privacy from '../../Privacy';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import loc from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
import isCatalyst from 'react-native-is-catalyst';
const currency = require('../../blue_modules/currency');
export default class SendCreate extends Component {
@ -247,25 +246,21 @@ SendCreate.propTypes = {
}),
};
SendCreate.navigationOptions = navigationStyle(
{
title: loc.send.create_details,
},
(options, { theme, navigation, route }) => {
let headerRight;
if (route.params.exportTXN) {
headerRight = () => (
<TouchableOpacity style={styles.export} onPress={route.params.exportTXN}>
<Icon size={22} name="share-alternative" type="entypo" color={BlueCurrentTheme.colors.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
SendCreate.navigationOptions = ({ navigation, route }) => {
let headerRight;
if (route.params.exportTXN) {
headerRight = () => (
<TouchableOpacity style={styles.export} onPress={route.params.exportTXN}>
<Icon size={22} name="share-alternative" type="entypo" color={BlueCurrentTheme.colors.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
...options,
headerRight,
};
},
);
return {
...BlueNavigationStyle(),
title: loc.send.create_details,
headerRight,
};
};

View File

@ -20,12 +20,8 @@ import {
} from 'react-native';
import { Icon } from 'react-native-elements';
import AsyncStorage from '@react-native-community/async-storage';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import RNFS from 'react-native-fs';
import BigNumber from 'bignumber.js';
import * as bitcoin from 'bitcoinjs-lib';
import {
BlueCreateTxNavigationStyle,
BlueButton,
BlueBitcoinAmount,
BlueAddressInput,
@ -35,7 +31,11 @@ import {
BlueListItem,
BlueText,
} from '../../BlueComponents';
import { navigationStyleTx } from '../../components/navigationStyle';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import BigNumber from 'bignumber.js';
import RNFS from 'react-native-fs';
import * as bitcoin from 'bitcoinjs-lib';
import NetworkTransactionFees, { NetworkTransactionFee } from '../../models/networkTransactionFees';
import { BitcoinUnit, Chain } from '../../models/bitcoinUnits';
import { HDSegwitBech32Wallet, LightningCustodianWallet, MultisigHDWallet, WatchOnlyWallet } from '../../class';
@ -205,11 +205,6 @@ const styles = StyleSheet.create({
feeValue: {
color: BlueCurrentTheme.colors.feeValue,
},
advancedOptions: {
minWidth: 40,
height: 40,
justifyContent: 'center',
},
});
export default class SendDetails extends Component {
@ -1474,28 +1469,7 @@ SendDetails.propTypes = {
}),
};
SendDetails.navigationOptions = navigationStyleTx(
{
title: loc.send.header,
},
(options, { theme, navigation, route }) => {
let headerRight;
if (route.params.withAdvancedOptionsMenuButton) {
headerRight = () => (
<TouchableOpacity
style={styles.advancedOptions}
onPress={route.params.advancedOptionsMenuButtonAction}
testID="advancedOptionsMenuButton"
>
<Icon size={22} name="kebab-horizontal" type="octicon" color={theme.colors.foregroundColor} />
</TouchableOpacity>
);
} else {
headerRight = null;
}
return {
...options,
headerRight,
};
},
);
SendDetails.navigationOptions = ({ navigation, route }) => ({
...BlueCreateTxNavigationStyle(navigation, route.params.withAdvancedOptionsMenuButton, route.params.advancedOptionsMenuButtonAction),
title: loc.send.header,
});

View File

@ -1,17 +1,15 @@
/* global alert */
import React, { useContext, useEffect, useState } from 'react';
import { FlatList, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { BlueButton, BlueCard, BlueNavigationStyle, BlueText, SafeBlueArea } from '../../BlueComponents';
import loc from '../../loc';
import { Icon } from 'react-native-elements';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueButton, BlueCard, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const bitcoin = require('bitcoinjs-lib');
const BigNumber = require('bignumber.js');
const currency = require('../../blue_modules/currency');
const BigNumber = require('bignumber.js');
const shortenAddress = addr => {
return addr.substr(0, Math.floor(addr.length / 2) - 1) + '\n' + addr.substr(Math.floor(addr.length / 2) - 1, addr.length);
@ -403,7 +401,8 @@ const styles = StyleSheet.create({
},
});
PsbtMultisig.navigationOptions = navigationStyle({
PsbtMultisig.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.multisig.header,
});

View File

@ -1,16 +1,14 @@
/* global alert */
import React, { useState } from 'react';
import { ActivityIndicator, Platform, ScrollView, StyleSheet, View } from 'react-native';
import { getSystemName } from 'react-native-device-info';
import ImagePicker from 'react-native-image-picker';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueSpacing20, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueNavigationStyle, BlueSpacing20, SafeBlueArea } from '../../BlueComponents';
import { DynamicQRCode } from '../../components/DynamicQRCode';
import { SquareButton } from '../../components/SquareButton';
import { getSystemName } from 'react-native-device-info';
import loc from '../../loc';
import ImagePicker from 'react-native-image-picker';
import ScanQRCode from './ScanQRCode';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
const bitcoin = require('bitcoinjs-lib');
const fs = require('../../blue_modules/fs');
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
@ -141,7 +139,8 @@ const styles = StyleSheet.create({
},
});
PsbtMultisigQRCode.navigationOptions = navigationStyle({
PsbtMultisigQRCode.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.multisig.header,
});

View File

@ -15,28 +15,27 @@ import {
} from 'react-native';
import ImagePicker from 'react-native-image-picker';
import Clipboard from '@react-native-community/clipboard';
import Share from 'react-native-share';
import { getSystemName } from 'react-native-device-info';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import DocumentPicker from 'react-native-document-picker';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import isCatalyst from 'react-native-is-catalyst';
import RNFS from 'react-native-fs';
import {
SecondButton,
BlueText,
SafeBlueArea,
BlueCard,
BlueNavigationStyle,
BlueSpacing20,
BlueCopyToClipboardButton,
DynamicQRCode,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import Share from 'react-native-share';
import { getSystemName } from 'react-native-device-info';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import RNFS from 'react-native-fs';
import DocumentPicker from 'react-native-document-picker';
import loc from '../../loc';
import ScanQRCode from './ScanQRCode';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import Notifications from '../../blue_modules/notifications';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import isCatalyst from 'react-native-is-catalyst';
const BlueElectrum = require('../../blue_modules/BlueElectrum');
/** @type {AppStorage} */
const bitcoin = require('bitcoinjs-lib');
@ -337,7 +336,8 @@ const PsbtWithHardwareWallet = () => {
export default PsbtWithHardwareWallet;
PsbtWithHardwareWallet.navigationOptions = navigationStyle({
PsbtWithHardwareWallet.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.send.header,
});

View File

@ -1,8 +1,6 @@
import React, { useContext, useEffect, useState } from 'react';
import { ScrollView, Platform, TouchableWithoutFeedback, TouchableOpacity, StyleSheet } from 'react-native';
import navigationStyle from '../../components/navigationStyle';
import { BlueLoading, BlueText, BlueSpacing20, BlueListItem, BlueCard } from '../../BlueComponents';
import { BlueLoading, BlueText, BlueSpacing20, BlueListItem, BlueNavigationStyle, BlueCard } from '../../BlueComponents';
import { useNavigation, useTheme } from '@react-navigation/native';
import HandoffSettings from '../../class/handoff';
import loc from '../../loc';
@ -90,7 +88,8 @@ const GeneralSettings = () => {
);
};
GeneralSettings.navigationOptions = navigationStyle({
GeneralSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.general,
});

View File

@ -1,9 +1,7 @@
import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { SafeBlueArea, BlueListItem, BlueNavigationStyle } from '../../BlueComponents';
import { useNavigation, useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem } from '../../BlueComponents';
import loc from '../../loc';
const NetworkSettings = () => {
@ -38,9 +36,8 @@ const NetworkSettings = () => {
</SafeBlueArea>
);
};
NetworkSettings.navigationOptions = navigationStyle({
NetworkSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.network,
});
export default NetworkSettings;

View File

@ -1,9 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
import { ScrollView, TouchableWithoutFeedback, StyleSheet, Linking } from 'react-native';
import { BlueText, BlueSpacing20, BlueListItem, BlueNavigationStyle, BlueCard } from '../../BlueComponents';
import { useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { BlueText, BlueSpacing20, BlueListItem, BlueCard } from '../../BlueComponents';
import loc from '../../loc';
import BlueClipboard from '../../blue_modules/clipboard';
import DeviceQuickActions from '../../class/quick-actions';
@ -102,7 +100,8 @@ const styles = StyleSheet.create({
},
});
SettingsPrivacy.navigationOptions = navigationStyle({
SettingsPrivacy.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.privacy,
});

View File

@ -1,11 +1,17 @@
import React from 'react';
import { ScrollView, Linking, Image, View, Text, StyleSheet, useWindowDimensions } from 'react-native';
import { useNavigation, useTheme } from '@react-navigation/native';
import {
BlueTextCentered,
BlueSpacing20,
BlueButton,
SafeBlueArea,
BlueCard,
BlueListItem,
BlueNavigationStyle,
} from '../../BlueComponents';
import { getApplicationName, getVersion, getBundleId, getBuildNumber } from 'react-native-device-info';
import Rate, { AndroidMarket } from 'react-native-rate';
import { BlueButton, BlueCard, BlueListItem, BlueSpacing20, BlueTextCentered, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
const About = () => {
@ -187,7 +193,8 @@ const About = () => {
);
};
About.navigationOptions = navigationStyle({
About.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: loc.settings.about,
});
export default About;

View File

@ -1,11 +1,10 @@
import React, { useState, useEffect } from 'react';
import { FlatList, ActivityIndicator, View, StyleSheet } from 'react-native';
import { useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem, BlueText, BlueCard } from '../../BlueComponents';
import { SafeBlueArea, BlueListItem, BlueText, BlueCard, BlueNavigationStyle } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { FiatUnit, FiatUnitSource } from '../../models/fiatUnit';
import loc from '../../loc';
import { useTheme } from '@react-navigation/native';
const currency = require('../../blue_modules/currency');
const data = Object.values(FiatUnit);
@ -83,8 +82,15 @@ const Currency = () => {
);
};
Currency.navigationOptions = navigationStyle({
Currency.propTypes = {
navigation: PropTypes.shape({
navigate: PropTypes.func,
goBack: PropTypes.func,
}),
};
Currency.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.currency,
});
export default Currency;

View File

@ -1,9 +1,7 @@
import React, { useContext, useEffect, useState } from 'react';
import { View, TouchableWithoutFeedback, StyleSheet } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueCard, BlueListItem, BlueText } from '../../BlueComponents';
import { SafeBlueArea, BlueCard, BlueNavigationStyle, BlueListItem, BlueText } from '../../BlueComponents';
import OnAppLaunch from '../../class/on-app-launch';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -80,7 +78,8 @@ const DefaultView = () => {
);
};
DefaultView.navigationOptions = navigationStyle({
DefaultView.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.default_title,
});

View File

@ -1,17 +1,24 @@
/* global alert */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, TextInput, StyleSheet } from 'react-native';
import DefaultPreference from 'react-native-default-preference';
import RNWidgetCenter from 'react-native-widget-center';
import { AppStorage } from '../../class';
import AsyncStorage from '@react-native-community/async-storage';
import { ScrollView } from 'react-native-gesture-handler';
import { AppStorage } from '../../class';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueButtonLink, BlueCard, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import {
BlueLoading,
BlueSpacing20,
BlueButton,
SafeBlueArea,
BlueCard,
BlueText,
BlueNavigationStyle,
BlueButtonLink,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import PropTypes from 'prop-types';
import loc from '../../loc';
import DefaultPreference from 'react-native-default-preference';
import RNWidgetCenter from 'react-native-widget-center';
const BlueElectrum = require('../../blue_modules/BlueElectrum');
export default class ElectrumSettings extends Component {
@ -212,7 +219,8 @@ ElectrumSettings.propTypes = {
}),
};
ElectrumSettings.navigationOptions = navigationStyle({
ElectrumSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.electrum_settings,
});

View File

@ -3,9 +3,6 @@ import React, { useEffect, useState, useCallback, useContext } from 'react';
import { ScrollView, Alert, Platform, TouchableOpacity, TouchableWithoutFeedback, StyleSheet } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { colors } from 'react-native-elements';
import navigationStyle from '../../components/navigationStyle';
import {
BlueLoading,
SafeBlueArea,
@ -14,9 +11,11 @@ import {
BlueListItem,
BlueHeaderDefaultSubHooks,
BlueText,
BlueNavigationStyle,
} from '../../BlueComponents';
import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { colors } from 'react-native-elements';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const prompt = require('../../blue_modules/prompt');
@ -203,6 +202,7 @@ const EncryptStorage = () => {
};
export default EncryptStorage;
EncryptStorage.navigationOptions = navigationStyle({
EncryptStorage.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: loc.settings.encrypt_title,
});

View File

@ -1,8 +1,6 @@
import React, { useState, useEffect, useCallback } from 'react';
import { FlatList, StyleSheet } from 'react-native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueListItem, BlueCard, BlueLoading, BlueText } from '../../BlueComponents';
import { SafeBlueArea, BlueListItem, BlueCard, BlueLoading, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import { AvailableLanguages } from '../../loc/languages';
import loc from '../../loc';
@ -53,7 +51,8 @@ const Language = () => {
);
};
Language.navigationOptions = navigationStyle({
Language.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: loc.settings.language,
});

View File

@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueCard, BlueText, BlueSpacing20, BlueLoading } from '../../BlueComponents';
import { SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueSpacing20, BlueLoading } from '../../BlueComponents';
/** @type {AppStorage} */
const styles = StyleSheet.create({
root: {
@ -51,7 +51,8 @@ const Licensing = () => {
);
};
Licensing.navigationOptions = navigationStyle({
Licensing.navigationOptions = () => ({
...BlueNavigationStyle(),
title: 'License',
});

View File

@ -3,11 +3,18 @@ import React, { useState, useEffect, useCallback } from 'react';
import { View, TextInput, Linking, StyleSheet } from 'react-native';
import { Button } from 'react-native-elements';
import { useTheme, useNavigation, useRoute } from '@react-navigation/native';
import AsyncStorage from '@react-native-community/async-storage';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueButtonLink, BlueCard, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import { AppStorage } from '../../class';
import AsyncStorage from '@react-native-community/async-storage';
import {
BlueSpacing20,
BlueButton,
SafeBlueArea,
BlueCard,
BlueNavigationStyle,
BlueLoading,
BlueText,
BlueButtonLink,
} from '../../BlueComponents';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import loc from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
@ -129,8 +136,8 @@ const LightningSettings = () => {
);
};
LightningSettings.navigationOptions = navigationStyle({
LightningSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.lightning_settings,
});
export default LightningSettings;

View File

@ -1,12 +1,19 @@
/* global alert */
import React, { useCallback, useEffect, useState } from 'react';
import { ScrollView, TouchableWithoutFeedback, StyleSheet, Linking, View, TextInput } from 'react-native';
import {
BlueLoading,
BlueText,
BlueSpacing20,
BlueListItem,
BlueNavigationStyle,
BlueCard,
BlueButton,
BlueCopyToClipboardButton,
} from '../../BlueComponents';
import { useTheme } from '@react-navigation/native';
import { Button } from 'react-native-elements';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueCard, BlueCopyToClipboardButton, BlueListItem, BlueLoading, BlueSpacing20, BlueText } from '../../BlueComponents';
import loc from '../../loc';
import { Button } from 'react-native-elements';
import { BlueCurrentTheme } from '../../components/themes';
import Notifications from '../../blue_modules/notifications';
@ -156,7 +163,8 @@ const NotificationSettings = () => {
);
};
NotificationSettings.navigationOptions = navigationStyle({
NotificationSettings.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.notifications,
});

View File

@ -1,8 +1,7 @@
import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import { useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { SafeBlueArea, BlueCard, BlueText } from '../../BlueComponents';
import loc from '../../loc';
const ReleaseNotes = () => {
@ -26,7 +25,8 @@ const ReleaseNotes = () => {
);
};
ReleaseNotes.navigationOptions = navigationStyle({
ReleaseNotes.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.settings.about_release_notes,
});

View File

@ -1,8 +1,7 @@
import React from 'react';
import { ScrollView, TouchableOpacity, StyleSheet, StatusBar } from 'react-native';
import { BlueListItem, BlueNavigationStyle, BlueHeaderDefaultSubHooks } from '../../BlueComponents';
import { useNavigation } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { BlueListItem, BlueHeaderDefaultSubHooks } from '../../BlueComponents';
import loc from '../../loc';
const styles = StyleSheet.create({
@ -48,6 +47,7 @@ const Settings = () => {
};
export default Settings;
Settings.navigationOptions = navigationStyle({
Settings.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: '',
});

View File

@ -5,9 +5,16 @@ import { ActivityIndicator, View, TextInput, TouchableOpacity, Linking, ScrollVi
import Clipboard from '@react-native-community/clipboard';
import { Text } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { BlueButton, BlueCard, BlueReplaceFeeSuggestions, BlueSpacing, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import {
BlueSpacing20,
BlueReplaceFeeSuggestions,
BlueButton,
SafeBlueArea,
BlueCard,
BlueText,
BlueSpacing,
BlueNavigationStyle,
} from '../../BlueComponents';
import { BlueCurrentTheme } from '../../components/themes';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import loc from '../../loc';
@ -243,6 +250,7 @@ CPFP.propTypes = {
}),
}),
};
CPFP.navigationOptions = navigationStyle({
CPFP.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.transactions.cpfp_title,
});

View File

@ -2,8 +2,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, View, ScrollView, StyleSheet } from 'react-native';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueText } from '../../BlueComponents';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle } from '../../BlueComponents';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import CPFP from './CPFP';
import loc from '../../loc';
@ -117,6 +116,8 @@ RBFBumpFee.propTypes = {
}),
}),
};
RBFBumpFee.navigationOptions = navigationStyle({
RBFBumpFee.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.transactions.rbf_title,
});

View File

@ -1,9 +1,8 @@
/* global alert */
import React from 'react';
import PropTypes from 'prop-types';
import { ActivityIndicator, View, StyleSheet, ScrollView } from 'react-native';
import { BlueSpacing20, SafeBlueArea, BlueText } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { HDSegwitBech32Transaction, HDSegwitBech32Wallet } from '../../class';
import CPFP from './CPFP';
import loc from '../../loc';
@ -128,6 +127,7 @@ RBFCancel.propTypes = {
}),
};
RBFCancel.navigationOptions = navigationStyle({
RBFCancel.navigationOptions = () => ({
...BlueNavigationStyle(null, false),
title: loc.transactions.cancel_title,
});

View File

@ -1,13 +1,20 @@
/* global alert */
import React, { useContext, useEffect, useState } from 'react';
import { View, ScrollView, TouchableOpacity, Text, TextInput, Linking, StatusBar, StyleSheet, Keyboard } from 'react-native';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import Handoff from 'react-native-handoff';
import { BlueCard, BlueCopyToClipboardButton, BlueLoading, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import {
SafeBlueArea,
BlueCard,
BlueText,
BlueLoading,
BlueSpacing20,
BlueCopyToClipboardButton,
BlueNavigationStyle,
} from '../../BlueComponents';
import HandoffSettings from '../../class/handoff';
import Handoff from 'react-native-handoff';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
const dayjs = require('dayjs');
function onlyUnique(value, index, self) {
@ -280,6 +287,7 @@ const styles = StyleSheet.create({
export default TransactionsDetails;
TransactionsDetails.navigationOptions = navigationStyle({
TransactionsDetails.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.transactions.details_title,
});

View File

@ -1,28 +1,26 @@
import React, { useContext, useEffect, useRef, useState } from 'react';
import { View, ActivityIndicator, Text, TouchableOpacity, StyleSheet, StatusBar } from 'react-native';
import { Icon } from 'react-native-elements';
import Handoff from 'react-native-handoff';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import {
BlueButton,
BlueCard,
BlueLoading,
BlueSpacing10,
BlueSpacing20,
BlueText,
BlueTransactionIncomingIcon,
SafeBlueArea,
BlueTransactionOutgoingIcon,
BlueTransactionPendingIcon,
SafeBlueArea,
BlueTransactionIncomingIcon,
BlueCard,
BlueText,
BlueLoading,
BlueSpacing20,
BlueNavigationStyle,
BlueSpacing10,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { HDSegwitBech32Transaction } from '../../class';
import { BitcoinUnit } from '../../models/bitcoinUnits';
import { Icon } from 'react-native-elements';
import Handoff from 'react-native-handoff';
import HandoffSettings from '../../class/handoff';
import loc, { formatBalanceWithoutSuffix } from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
const buttonStatus = Object.freeze({
possible: 1,
unknown: 2,
@ -456,6 +454,7 @@ const styles = StyleSheet.create({
},
});
TransactionsStatus.navigationOptions = navigationStyle({
TransactionsStatus.navigationOptions = () => ({
...BlueNavigationStyle(),
title: '',
});

View File

@ -21,10 +21,10 @@ import {
VaultButton,
BlueFormLabel,
BlueButton,
BlueNavigationStyle,
BlueButtonLink,
BlueSpacing20,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { HDSegwitBech32Wallet, SegwitP2SHWallet, HDSegwitP2SHWallet, LightningCustodianWallet, AppStorage } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { useTheme, useNavigation } from '@react-navigation/native';
@ -334,8 +334,8 @@ const WalletsAdd = () => {
);
};
WalletsAdd.navigationOptions = navigationStyle({
closeButton: true,
WalletsAdd.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
headerTitle: loc.wallets.add_title,
headerLeft: null,
});

View File

@ -5,8 +5,7 @@ import { Icon } from 'react-native-elements';
import { useNavigation, useTheme } from '@react-navigation/native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { BlueButton, BlueListItem, BlueSpacing20 } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueListItem, BlueNavigationStyle, BlueSpacing20 } from '../../BlueComponents';
import BottomModal from '../../components/BottomModal';
import { MultisigHDWallet } from '../../class';
import loc from '../../loc';
@ -345,7 +344,8 @@ WalletsAddMultisig.getCurrentFormatReadable = f => {
}
};
WalletsAddMultisig.navigationOptions = navigationStyle({
WalletsAddMultisig.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: null,
});

View File

@ -13,36 +13,35 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import { Icon } from 'react-native-elements';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { getSystemName } from 'react-native-device-info';
import ImagePicker from 'react-native-image-picker';
import QRCode from 'react-native-qrcode-svg';
import Clipboard from '@react-native-community/clipboard';
import showPopupMenu from 'react-native-popup-menu-android';
import ToolTip from 'react-native-tooltip';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import {
BlueButton,
BlueButtonLink,
BlueFormMultiInput,
BlueLoading,
BlueNavigationStyle,
BlueSpacing10,
BlueSpacing20,
BlueSpacing40,
BlueTextCentered,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { Icon } from 'react-native-elements';
import { HDSegwitBech32Wallet, MultisigCosigner, MultisigHDWallet } from '../../class';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import loc from '../../loc';
import { getSystemName } from 'react-native-device-info';
import ImagePicker from 'react-native-image-picker';
import ScanQRCode from '../send/ScanQRCode';
import QRCode from 'react-native-qrcode-svg';
import { SquareButton } from '../../components/SquareButton';
import BottomModal from '../../components/BottomModal';
import MultipleStepsListItem, {
MultipleStepsListItemButtohType,
MultipleStepsListItemDashType,
} from '../../components/MultipleStepsListItem';
import Clipboard from '@react-native-community/clipboard';
import showPopupMenu from 'react-native-popup-menu-android';
import ToolTip from 'react-native-tooltip';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const prompt = require('../../blue_modules/prompt');
@ -765,7 +764,8 @@ const styles = StyleSheet.create({
qrCodeContainer: { borderWidth: 6, borderRadius: 8, borderColor: '#FFFFFF' },
});
WalletsAddMultisigStep2.navigationOptions = navigationStyle({
WalletsAddMultisigStep2.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: null,
});

View File

@ -1,16 +1,13 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, StatusBar, Linking, Platform } from 'react-native';
import { BlueNavigationStyle, BlueLoading, SafeBlueArea } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { WebView } from 'react-native-webview';
import InAppBrowser from 'react-native-inappbrowser-reborn';
import { BlueLoading, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { LightningCustodianWallet, WatchOnlyWallet } from '../../class';
import InAppBrowser from 'react-native-inappbrowser-reborn';
import * as NavigationService from '../../NavigationService';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const currency = require('../../blue_modules/currency');
const styles = StyleSheet.create({
root: {
flex: 1,
@ -108,8 +105,8 @@ BuyBitcoin.propTypes = {
}),
};
BuyBitcoin.navigationOptions = navigationStyle({
closeButton: true,
BuyBitcoin.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: '',
headerLeft: null,
});

View File

@ -16,8 +16,7 @@ import {
StatusBar,
PermissionsAndroid,
} from 'react-native';
import { SecondButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueText, BlueLoading } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { SecondButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle, BlueText, BlueLoading } from '../../BlueComponents';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import { HDLegacyBreadwalletWallet } from '../../class/wallets/hd-legacy-breadwallet-wallet';
import { HDLegacyP2PKHWallet } from '../../class/wallets/hd-legacy-p2pkh-wallet';
@ -526,7 +525,8 @@ const WalletDetails = () => {
);
};
WalletDetails.navigationOptions = navigationStyle({
WalletDetails.navigationOptions = () => ({
...BlueNavigationStyle(),
headerTitle: loc.wallets.details_title,
});

View File

@ -1,16 +1,18 @@
import React, { useContext, useEffect, useRef, useState } from 'react';
import { StatusBar, View, StyleSheet, Alert, useWindowDimensions } from 'react-native';
import { StatusBar, View, TouchableOpacity, StyleSheet, Alert, useWindowDimensions } from 'react-native';
import { DrawerContentScrollView } from '@react-navigation/drawer';
import { BlueNavigationStyle, BlueHeaderDefaultMain } from '../../BlueComponents';
import WalletsCarousel from '../../components/WalletsCarousel';
import { Icon } from 'react-native-elements';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import PropTypes from 'prop-types';
import { useTheme } from '@react-navigation/native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { BlueHeaderDefaultMain } from '../../BlueComponents';
import WalletsCarousel from '../../components/WalletsCarousel';
import { PlaceholderWallet } from '../../class';
import WalletImport from '../../class/wallet-import';
import * as NavigationService from '../../NavigationService';
import loc from '../../loc';
import { BlueCurrentTheme } from '../../components/themes';
import { useTheme } from '@react-navigation/native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const DrawerList = props => {
@ -129,7 +131,6 @@ const DrawerList = props => {
};
export default DrawerList;
const styles = StyleSheet.create({
contentContainerCustomStyle: {
paddingRight: 10,
@ -156,3 +157,22 @@ DrawerList.propTypes = {
params: PropTypes.object,
}),
};
DrawerList.navigationOptions = ({ navigation }) => {
return {
...BlueNavigationStyle(navigation, true),
title: '',
headerStyle: {
backgroundColor: BlueCurrentTheme.colors.customHeader,
borderBottomWidth: 0,
elevation: 0,
shadowOpacity: 0,
shadowOffset: { height: 0, width: 0 },
},
headerRight: () => (
<TouchableOpacity testID="SettingsButton" style={styles.headerTouch} onPress={() => NavigationService.navigate('Settings')}>
<Icon size={22} name="kebab-horizontal" type="octicon" color={BlueCurrentTheme.colors.foregroundColor} />
</TouchableOpacity>
),
};
};

View File

@ -1,14 +1,12 @@
import React, { useState, useCallback, useContext, useRef } from 'react';
import { useWindowDimensions, InteractionManager, ScrollView, ActivityIndicator, StatusBar, View, StyleSheet } from 'react-native';
import QRCode from 'react-native-qrcode-svg';
import { useTheme, useNavigation, useFocusEffect, useRoute } from '@react-navigation/native';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard, BlueCard } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText, BlueCopyTextToClipboard, BlueCard } from '../../BlueComponents';
import Privacy from '../../Privacy';
import Biometric from '../../class/biometrics';
import { LegacyWallet, LightningCustodianWallet, SegwitBech32Wallet, SegwitP2SHWallet, WatchOnlyWallet } from '../../class';
import loc from '../../loc';
import { useTheme, useNavigation, useFocusEffect, useRoute } from '@react-navigation/native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const styles = StyleSheet.create({
@ -132,8 +130,8 @@ const WalletExport = () => {
);
};
WalletExport.navigationOptions = navigationStyle({
closeButton: true,
WalletExport.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.wallets.export_title,
headerLeft: null,
});

View File

@ -1,13 +1,11 @@
import React, { useCallback, useContext, useState } from 'react';
import { ActivityIndicator, InteractionManager, ScrollView, StatusBar, StyleSheet, View } from 'react-native';
import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueNavigationStyle, BlueSpacing20, BlueText, SafeBlueArea } from '../../BlueComponents';
import { DynamicQRCode } from '../../components/DynamicQRCode';
import Privacy from '../../Privacy';
import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { useFocusEffect, useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { SquareButton } from '../../components/SquareButton';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const fs = require('../../blue_modules/fs');
@ -120,8 +118,8 @@ const styles = StyleSheet.create({
},
});
ExportMultisigCoordinationSetup.navigationOptions = navigationStyle({
closeButton: true,
ExportMultisigCoordinationSetup.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.multisig.export_coordination_setup,
headerLeft: null,
});

View File

@ -22,8 +22,7 @@ import {
} from 'react-native';
import Geolocation from '@react-native-community/geolocation';
import { BlueButtonLink, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueButtonLink, BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import { HodlHodlApi } from '../../class/hodl-hodl-api';
import * as NavigationService from '../../NavigationService';
import { BlueCurrentTheme } from '../../components/themes';
@ -882,25 +881,21 @@ HodlHodl.propTypes = {
}),
};
HodlHodl.navigationOptions = navigationStyle(
{
title: '',
HodlHodl.navigationOptions = ({ navigation, route }) => ({
...BlueNavigationStyle(navigation, true),
title: '',
headerStyle: {
...BlueNavigationStyle(navigation, true).headerStyle,
backgroundColor: BlueCurrentTheme.colors.customHeader,
},
(options, { theme, navigation, route }) => ({
...options,
headerStyle: {
...options.headerStyle,
backgroundColor: theme.colors.customHeader,
},
headerRight: () => {
return route.params.displayLoginButton ? (
<BlueButtonLink title={loc.hodl.login} onPress={route.params.handleLoginPress} style={styles.marginHorizontal20} />
) : (
<BlueButtonLink title={loc.hodl.mycont} onPress={route.params.handleMyContractsPress} style={styles.marginHorizontal20} />
);
},
}),
);
headerRight: () => {
return route.params.displayLoginButton ? (
<BlueButtonLink title={loc.hodl.login} onPress={route.params.handleLoginPress} style={styles.marginHorizontal20} />
) : (
<BlueButtonLink title={loc.hodl.mycont} onPress={route.params.handleMyContractsPress} style={styles.marginHorizontal20} />
);
},
});
const styles = StyleSheet.create({
grayDropdownText: {

View File

@ -1,9 +1,7 @@
import React, { useRef } from 'react';
import { WebView } from 'react-native-webview';
import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import { useRoute, useNavigation } from '@react-navigation/native';
import { SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import loc from '../../loc';
const url = 'https://accounts.hodlhodl.com/accounts/request_access?attributes=api_key,api_signature_key';
@ -53,8 +51,8 @@ const HodlHodlLogin = () => {
);
};
HodlHodlLogin.navigationOptions = navigationStyle({
closeButton: true,
HodlHodlLogin.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.hodl.login,
headerLeft: null,
});

View File

@ -1,6 +1,5 @@
/* global alert */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
Alert,
FlatList,
@ -15,8 +14,15 @@ import {
View,
} from 'react-native';
import { BlueButton, BlueCopyTextToClipboard, BlueLoading, BlueSpacing10, BlueSpacing20, BlueText } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import {
BlueButton,
BlueCopyTextToClipboard,
BlueLoading,
BlueNavigationStyle,
BlueSpacing10,
BlueSpacing20,
BlueText,
} from '../../BlueComponents';
import { HodlHodlApi } from '../../class/hodl-hodl-api';
import * as NavigationService from '../../NavigationService';
import { BlueCurrentTheme } from '../../components/themes';
@ -29,7 +35,6 @@ export default class HodlHodlMyContracts extends Component {
constructor(props) {
super(props);
props.navigation.setParams({ handleLogout: this.handleLogout });
this.state = {
contracts: [],
isLoading: true,
@ -40,11 +45,6 @@ export default class HodlHodlMyContracts extends Component {
clearInterval(this.state.inverval);
}
handleLogout = () => {
this.context.setHodlHodlApiKey('', '<empty>');
this.props.navigation.navigate('WalletsList');
};
async componentDidMount() {
const hodlApiKey = await this.context.getHodlHodlApiKey();
const hodlApi = new HodlHodlApi(hodlApiKey);
@ -424,44 +424,35 @@ const styles = StyleSheet.create({
},
});
HodlHodlMyContracts.propTypes = {
navigation: PropTypes.shape({
navigate: PropTypes.func,
setParams: PropTypes.func,
}),
};
HodlHodlMyContracts.navigationOptions = navigationStyle(
{
closeButton: true,
title: loc.hodl.cont_title,
HodlHodlMyContracts.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.hodl.cont_title,
headerStyle: {
backgroundColor: BlueCurrentTheme.colors.elevated,
},
(options, { theme, navigation, route }) => ({
...options,
headerStyle: {
backgroundColor: theme.colors.elevated,
},
headerRight: () => (
<TouchableOpacity
style={styles.marginRight}
onPress={() => {
Alert.alert(
loc.hodl.are_you_sure_you_want_to_logout,
'',
[
{
text: loc._.ok,
onPress: route.params.handleLogout,
style: 'default',
headerRight: () => (
<TouchableOpacity
style={styles.marginRight}
onPress={() => {
Alert.alert(
loc.hodl.are_you_sure_you_want_to_logout,
'',
[
{
text: loc._.ok,
onPress: () => {
this.context.setHodlHodlApiKey('', '<empty>');
navigation.navigate('WalletsList');
},
{ text: loc._.cancel, onPress: () => {}, style: 'cancel' },
],
{ cancelable: false },
);
}}
>
<BlueText>{loc.hodl.logout}</BlueText>
</TouchableOpacity>
),
}),
);
style: 'default',
},
{ text: loc._.cancel, onPress: () => {}, style: 'cancel' },
],
{ cancelable: false },
);
}}
>
<BlueText>logout</BlueText>
</TouchableOpacity>
),
});

View File

@ -1,12 +1,10 @@
/* global alert */
import React, { Component } from 'react';
import { Alert, FlatList, Image, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, Text, View } from 'react-native';
import { BlueButton, BlueLoading, BlueNavigationStyle, BlueSpacing10, SafeBlueArea } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { Icon } from 'react-native-elements';
import navigationStyle from '../../components/navigationStyle';
import { BlueButton, BlueLoading, BlueSpacing10, SafeBlueArea } from '../../BlueComponents';
import { HodlHodlApi } from '../../class/hodl-hodl-api';
import { Icon } from 'react-native-elements';
import * as NavigationService from '../../NavigationService';
import { BlueCurrentTheme } from '../../components/themes';
import loc from '../../loc';
@ -382,15 +380,11 @@ const styles = StyleSheet.create({
acceptOfferButtonWrapperWrapper: { marginTop: 24, alignItems: 'center' },
});
HodlHodlViewOffer.navigationOptions = navigationStyle(
{
title: '',
HodlHodlViewOffer.navigationOptions = () => ({
...BlueNavigationStyle(),
title: '',
headerStyle: {
...BlueNavigationStyle().headerStyle,
backgroundColor: BlueCurrentTheme.colors.customHeader,
},
(options, { theme }) => ({
...options,
headerStyle: {
...options.headerStyle,
backgroundColor: theme.colors.customHeader,
},
}),
);
});

View File

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import { WebView } from 'react-native-webview';
import { BlueNavigationStyle, SafeBlueArea } from '../../BlueComponents';
import PropTypes from 'prop-types';
import { SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
export default class HodlHodlWebview extends Component {
constructor(props) {
super(props);
@ -33,8 +31,8 @@ HodlHodlWebview.propTypes = {
}),
};
HodlHodlWebview.navigationOptions = navigationStyle({
closeButton: true,
HodlHodlWebview.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: '',
headerLeft: null,
});

View File

@ -1,14 +1,6 @@
/* global alert */
import React, { useEffect, useState } from 'react';
import { Platform, View, Keyboard, StatusBar, StyleSheet } from 'react-native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import Clipboard from '@react-native-community/clipboard';
import ImagePicker from 'react-native-image-picker';
import { getSystemName } from 'react-native-device-info';
import RNFS from 'react-native-fs';
import DocumentPicker from 'react-native-document-picker';
import {
BlueFormMultiInput,
BlueButtonLink,
@ -17,12 +9,19 @@ import {
BlueButton,
SafeBlueArea,
BlueSpacing20,
BlueNavigationStyle,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import Privacy from '../../Privacy';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import WalletImport from '../../class/wallet-import';
import Clipboard from '@react-native-community/clipboard';
import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker';
import loc from '../../loc';
import { getSystemName } from 'react-native-device-info';
import RNFS from 'react-native-fs';
import DocumentPicker from 'react-native-document-picker';
import { presentCameraNotAuthorizedAlert } from '../../class/camera';
const LocalQRCode = require('@remobile/react-native-qrcode-local-image');
const isDesktop = getSystemName() === 'Mac OS X';
@ -268,7 +267,8 @@ const WalletsImport = () => {
);
};
WalletsImport.navigationOptions = navigationStyle({
WalletsImport.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.wallets.import_title,
});
export default WalletsImport;

View File

@ -1,10 +1,8 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { BackHandler } from 'react-native';
import { WebView } from 'react-native-webview';
import { BlueLoading } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueLoading, BlueNavigationStyle } from '../../BlueComponents';
import PropTypes from 'prop-types';
export default class Marketplace extends Component {
webview = React.createRef();
@ -77,8 +75,8 @@ Marketplace.propTypes = {
}),
};
Marketplace.navigationOptions = navigationStyle({
closeButton: true,
Marketplace.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: 'Marketplace',
headerLeft: null,
});

View File

@ -1,9 +1,7 @@
import React, { useEffect, useState, useCallback, useContext } from 'react';
import { ActivityIndicator, View, BackHandler, Text, ScrollView, StyleSheet, StatusBar } from 'react-native';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueButton } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText, BlueButton } from '../../BlueComponents';
import Privacy from '../../Privacy';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -87,15 +85,14 @@ const PleaseBackup = () => {
);
};
PleaseBackup.navigationOptions = navigationStyle({
closeButton: true,
PleaseBackup.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.pleasebackup.title,
headerLeft: null,
headerRight: null,
gestureEnabled: false,
swipeEnabled: false,
});
const styles = StyleSheet.create({
flex: {
flex: 1,

View File

@ -1,12 +1,17 @@
import React, { useCallback, useContext, useEffect } from 'react';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { View, useWindowDimensions, StyleSheet, BackHandler, StatusBar } from 'react-native';
import {
SafeBlueArea,
BlueNavigationStyle,
BlueSpacing20,
BlueCopyTextToClipboard,
BlueButton,
BlueTextCentered,
} from '../../BlueComponents';
import QRCode from 'react-native-qrcode-svg';
import { ScrollView } from 'react-native-gesture-handler';
import { BlueButton, BlueCopyTextToClipboard, BlueSpacing20, BlueTextCentered, SafeBlueArea } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import Privacy from '../../Privacy';
import { ScrollView } from 'react-native-gesture-handler';
import loc from '../../loc';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -75,8 +80,8 @@ const PleaseBackupLNDHub = () => {
);
};
PleaseBackupLNDHub.navigationOptions = navigationStyle({
closeButton: true,
PleaseBackupLNDHub.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.pleasebackup.title,
headerLeft: null,
headerRight: null,

View File

@ -3,12 +3,11 @@ import PropTypes from 'prop-types';
import BN from 'bignumber.js';
import { Dimensions, PixelRatio, View, ScrollView, Text, Image, TouchableOpacity, StyleSheet, useWindowDimensions } from 'react-native';
import { Icon } from 'react-native-elements';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { useNavigation, useRoute, useTheme } from '@react-navigation/native';
import { BlueCurrentTheme } from '../../components/themes';
import { FContainer, FButton } from '../../components/FloatButtons';
import { BlueSpacing20, SafeBlueArea, BlueTabs } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueTabs } from '../../BlueComponents';
import loc from '../../loc';
const ENTROPY_LIMIT = 256;
@ -271,7 +270,15 @@ const Entropy = () => {
);
};
Entropy.navigationOptions = navigationStyle({
Entropy.propTypes = {
navigation: PropTypes.shape({
navigate: PropTypes.func,
goBack: PropTypes.func,
}),
};
Entropy.navigationOptions = () => ({
...BlueNavigationStyle(),
title: loc.entropy.title,
});

View File

@ -1,14 +1,13 @@
import React, { useEffect, useState, useRef, useContext } from 'react';
import { View, ActivityIndicator, Image, Text, StyleSheet, StatusBar, ScrollView } from 'react-native';
import { BlueNavigationStyle } from '../../BlueComponents';
import SortableList from 'react-native-sortable-list';
import LinearGradient from 'react-native-linear-gradient';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { useNavigation, useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { PlaceholderWallet, LightningCustodianWallet, MultisigHDWallet } from '../../class';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/wallet-gradient';
import loc, { formatBalance, transactionTimeToReadable } from '../../loc';
import { useNavigation, useTheme } from '@react-navigation/native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const styles = StyleSheet.create({
@ -188,14 +187,13 @@ const ReorderWallets = () => {
);
};
ReorderWallets.navigationOptions = navigationStyle({
title: loc.wallets.reorder_title,
closeButton: true,
closeButtonFunc: ({ navigation, route }) => {
if (route.params && route.params.customCloseButtonFunction) {
route.params.customCloseButtonFunction();
}
},
ReorderWallets.navigationOptions = ({ navigation, route }) => ({
...BlueNavigationStyle(
navigation,
true,
route.params && route.params.customCloseButtonFunction ? route.params.customCloseButtonFunction : undefined,
),
headerTitle: loc.wallets.reorder_title,
headerLeft: null,
});

View File

@ -1,14 +1,12 @@
/* eslint-disable react/prop-types */
import React, { useContext, useEffect, useState } from 'react';
import { View, ActivityIndicator, Image, Text, TouchableOpacity, FlatList, StyleSheet, StatusBar } from 'react-native';
import { SafeBlueArea, BlueText, BlueSpacing20, BluePrivateBalance, BlueNavigationStyle } from '../../BlueComponents';
import LinearGradient from 'react-native-linear-gradient';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import { useRoute, useTheme } from '@react-navigation/native';
import { SafeBlueArea, BlueText, BlueSpacing20, BluePrivateBalance } from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import { LightningCustodianWallet } from '../../class/wallets/lightning-custodian-wallet';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
import WalletGradient from '../../class/wallet-gradient';
import { useRoute, useTheme } from '@react-navigation/native';
import loc, { formatBalance, transactionTimeToReadable } from '../../loc';
import { MultisigHDWallet } from '../../class';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -172,8 +170,11 @@ const SelectWallet = ({ navigation }) => {
}
};
SelectWallet.navigationOptions = navigationStyle({
title: loc.wallets.select_wallet,
SelectWallet.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
headerRight: null,
headerTitle: loc.wallets.select_wallet,
headerBackTitleVisible: false,
});
export default SelectWallet;

View File

@ -23,17 +23,15 @@ import Clipboard from '@react-native-community/clipboard';
import { Icon } from 'react-native-elements';
import Handoff from 'react-native-handoff';
import { useRoute, useNavigation, useTheme, useFocusEffect } from '@react-navigation/native';
import isCatalyst from 'react-native-is-catalyst';
import { Chain } from '../../models/bitcoinUnits';
import { BlueTransactionListItem, BlueWalletNavigationHeader, BlueAlertWalletExportReminder, BlueListItem } from '../../BlueComponents';
import WalletGradient from '../../class/wallet-gradient';
import navigationStyle from '../../components/navigationStyle';
import { LightningCustodianWallet, WatchOnlyWallet } from '../../class';
import HandoffSettings from '../../class/handoff';
import ActionSheet from '../ActionSheet';
import loc from '../../loc';
import { FContainer, FButton } from '../../components/FloatButtons';
import isCatalyst from 'react-native-is-catalyst';
import BottomModal from '../../components/BottomModal';
import BuyBitcoin from './buyBitcoin';
import { BlueStorageContext } from '../../blue_modules/storage-context';
@ -695,7 +693,7 @@ const WalletTransactions = () => {
export default WalletTransactions;
WalletTransactions.navigationOptions = navigationStyle({}, (options, { theme, navigation, route }) => {
WalletTransactions.navigationOptions = ({ navigation, route }) => {
return {
headerRight: () => (
<TouchableOpacity
@ -710,7 +708,7 @@ WalletTransactions.navigationOptions = navigationStyle({}, (options, { theme, na
<Icon name="kebab-horizontal" type="octicon" size={22} color="#FFFFFF" />
</TouchableOpacity>
),
title: '',
headerTitle: '',
headerStyle: {
backgroundColor: WalletGradient.headerColorFor(route.params.walletType),
borderBottomWidth: 0,
@ -721,7 +719,7 @@ WalletTransactions.navigationOptions = navigationStyle({}, (options, { theme, na
headerTintColor: '#FFFFFF',
headerBackTitleVisible: false,
};
});
};
const styles = StyleSheet.create({
flex: {

View File

@ -25,12 +25,12 @@ import {
BlueButtonLink,
BlueFormMultiInput,
BlueLoading,
BlueNavigationStyle,
BlueSpacing10,
BlueSpacing20,
BlueSpacing40,
BlueTextCentered,
} from '../../BlueComponents';
import navigationStyle from '../../components/navigationStyle';
import SquareEnumeratedWords, { SquareEnumeratedWordsContentAlign } from '../../components/SquareEnumeratedWords';
import BottomModal from '../../components/BottomModal';
import { HDSegwitBech32Wallet, MultisigHDWallet } from '../../class';
@ -574,8 +574,8 @@ const styles = StyleSheet.create({
squareButtonWrapper: { height: 50, width: 250 },
});
ViewEditMultisigCosigners.navigationOptions = navigationStyle({
closeButton: true,
ViewEditMultisigCosigners.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.multisig.view_edit_cosigners_title,
headerLeft: null,
});

View File

@ -1,13 +1,11 @@
import React, { useCallback, useContext, useState } from 'react';
import { InteractionManager, useWindowDimensions, ActivityIndicator, View, StatusBar, StyleSheet } from 'react-native';
import QRCode from 'react-native-qrcode-svg';
import { useFocusEffect, useRoute, useNavigation, useTheme } from '@react-navigation/native';
import navigationStyle from '../../components/navigationStyle';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueCopyTextToClipboard } from '../../BlueComponents';
import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle, BlueCopyTextToClipboard } from '../../BlueComponents';
import Privacy from '../../Privacy';
import Biometric from '../../class/biometrics';
import loc from '../../loc';
import { useFocusEffect, useRoute, useNavigation, useTheme } from '@react-navigation/native';
import { BlueStorageContext } from '../../blue_modules/storage-context';
const styles = StyleSheet.create({
@ -99,8 +97,8 @@ const WalletXpub = () => {
);
};
WalletXpub.navigationOptions = navigationStyle({
closeButton: true,
WalletXpub.navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true),
title: loc.wallets.xpub_title,
headerLeft: null,
});