FIX: view invoice will not allow you to go back if it is an initial screen

This commit is contained in:
Marcos Rodriguez Vélez 2018-12-29 22:33:41 -05:00
parent eaddee91a6
commit ef7d543c6a
6 changed files with 25 additions and 33 deletions

View file

@ -132,6 +132,17 @@ const CreateTransactionStackNavigator = createStackNavigator({
},
});
const LNDViewInvoiceStackNavigator = createStackNavigator({
LNDViewInvoice: {
screen: LNDViewInvoice,
swipeEnabled: false,
gesturesEnabled: false,
},
LNDViewAdditionalInvoiceInformation: {
screen: LNDViewAdditionalInvoiceInformation,
},
});
const LNDCreateInvoiceStackNavigator = createStackNavigator({
LNDCreateInvoice: {
screen: LNDCreateInvoice,
@ -221,7 +232,12 @@ const MainBottomTabs = createStackNavigator(
header: null,
},
},
LNDViewExistingInvoice: {
screen: LNDViewInvoiceStackNavigator,
navigationOptions: {
header: null,
},
},
// Select Wallet. Mostly for deep-linking
SelectWallet: {

View file

@ -33,7 +33,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>189</string>
<string>190</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View file

@ -28,7 +28,7 @@ export default class ScanLndInvoice extends React.Component {
if (!BlueApp.getWallets().some(item => item.type === LightningCustodianWallet.type)) {
alert('Before paying a Lightning invoice, you must first add a Lightning wallet.');
props.navigation.dismiss()
props.navigation.dismiss();
} else {
let fromSecret;
if (props.navigation.state.params.fromSecret) fromSecret = props.navigation.state.params.fromSecret;
@ -280,6 +280,7 @@ ScanLndInvoice.propTypes = {
goBack: PropTypes.function,
navigate: PropTypes.function,
getParam: PropTypes.function,
dismiss: PropTypes.function,
state: PropTypes.shape({
params: PropTypes.shape({
uri: PropTypes.string,

View file

@ -1,8 +1,7 @@
/* global alert */
import React, { Component } from 'react';
import { ScrollView } from 'react-native';
import Ionicons from 'react-native-vector-icons/Ionicons';
import { BlueLoading, BlueButton, SafeBlueArea, BlueCard, BlueText, BlueHeader, BlueSpacing20 } from '../BlueComponents';
import { BlueLoading, BlueButton, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle, BlueSpacing20 } from '../BlueComponents';
import PropTypes from 'prop-types';
/** @type {AppStorage} */
let BlueApp = require('../BlueApp');
@ -12,10 +11,8 @@ let loc = require('../loc');
export default class PlausibleDeniability extends Component {
static navigationOptions = {
tabBarLabel: loc.plausibledeniability.title,
tabBarIcon: ({ tintColor, focused }) => (
<Ionicons name={focused ? 'ios-settings' : 'ios-settings-outline'} size={26} style={{ color: tintColor }} />
),
...BlueNavigationStyle(),
title: loc.plausibledeniability.title,
};
constructor(props) {
@ -38,14 +35,6 @@ export default class PlausibleDeniability extends Component {
return (
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
<BlueHeader
backgroundColor={BlueApp.settings.brandingColor}
centerComponent={{
text: loc.plausibledeniability.title,
style: { color: BlueApp.settings.foregroundColor, fontSize: 23 },
}}
/>
<BlueCard>
<ScrollView maxHeight={450}>
<BlueText>{loc.plausibledeniability.help}</BlueText>
@ -85,20 +74,6 @@ export default class PlausibleDeniability extends Component {
this.props.navigation.navigate('Wallets');
}}
/>
<BlueSpacing20 />
<BlueButton
icon={{
name: 'arrow-left',
type: 'octicon',
color: BlueApp.settings.buttonTextColor,
}}
title={loc.plausibledeniability.go_back}
onPress={() => {
this.props.navigation.goBack();
}}
/>
</ScrollView>
</BlueCard>
</SafeBlueArea>

View file

@ -665,7 +665,7 @@ SendDetails.propTypes = {
navigation: PropTypes.shape({
goBack: PropTypes.function,
navigate: PropTypes.func,
dismiss: PropTypes.func,
dismiss: PropTypes.function,
state: PropTypes.shape({
params: PropTypes.shape({
address: PropTypes.string,

View file

@ -519,7 +519,7 @@ export default class WalletTransactions extends Component {
hash: rowData.item.hash,
});
} else if (rowData.item.type === 'user_invoice' || rowData.item.type === 'payment_request') {
this.props.navigation.navigate('LNDViewInvoice', {
this.props.navigation.navigate('LNDViewExistingInvoice', {
invoice: rowData.item,
fromWallet: this.state.wallet,
});