FIX: LND Invoice pushes in nav. Following on-chain tx behavior.

This commit is contained in:
Marcos Rodriguez Vélez 2019-01-14 01:55:55 -05:00
parent e4057a1923
commit e473a9d959
8 changed files with 30 additions and 33 deletions

View File

@ -105,6 +105,14 @@ const WalletsStackNavigator = createStackNavigator(
screen: LightningSettings,
path: 'LightningSettings',
},
LNDViewInvoice: {
screen: LNDViewInvoice,
swipeEnabled: false,
gesturesEnabled: false,
},
LNDViewAdditionalInvoiceInformation: {
screen: LNDViewAdditionalInvoiceInformation,
},
},
{ headerBackTitleVisible: false },
);
@ -149,17 +157,6 @@ const ManageFundsStackNavigator = createStackNavigator({
},
});
const LNDViewInvoiceStackNavigator = createStackNavigator({
LNDViewInvoice: {
screen: LNDViewInvoice,
swipeEnabled: false,
gesturesEnabled: false,
},
LNDViewAdditionalInvoiceInformation: {
screen: LNDViewAdditionalInvoiceInformation,
},
});
const LNDCreateInvoiceStackNavigator = createStackNavigator({
LNDCreateInvoice: {
screen: LNDCreateInvoice,
@ -260,12 +257,6 @@ const MainBottomTabs = createStackNavigator(
header: null,
},
},
LNDViewExistingInvoice: {
screen: LNDViewInvoiceStackNavigator,
navigationOptions: {
header: null,
},
},
},
{
mode: 'modal',

14
package-lock.json generated
View File

@ -3445,9 +3445,9 @@
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs="
},
"dayjs": {
"version": "1.7.8",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.7.8.tgz",
"integrity": "sha512-Gp4Y5KWeSri0QOWGzHQz7VrKDkfEpS92dCLK7P8hYowRFbaym1vj3d6CoHio3apSS4KSi/qb5Edemv26IN5Hfg=="
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.8.0.tgz",
"integrity": "sha512-2ofInmfMKLLR5R02q3WEUuDt86UK33VQQTaEeJudF+C04ZUaekCP3VpB0NJPiyPDCGJWq9XYhHX2AemdxA8+dg=="
},
"debug": {
"version": "4.1.1",
@ -9547,9 +9547,9 @@
}
},
"react-native-webview": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-2.8.0.tgz",
"integrity": "sha512-JNpAm4vOJ17xBWeZdNTlFdmDHz3E0n8VILahISSyN6Flzlv1Cmw/i/H/no7HWE990ipZNTuG4VaDxCPeJ5vJlg==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/react-native-webview/-/react-native-webview-3.1.2.tgz",
"integrity": "sha512-lnbLqyFNm3kbjyzXhjHfmcw/A1hf7KuVpjJ/ZmLMEoha6OrppDqYkirEO28Hg9rMTmsZ9pqXYNQOL51L4GiDfQ==",
"requires": {
"escape-string-regexp": "^1.0.5",
"fbjs": "^0.8.17"
@ -9557,7 +9557,7 @@
"dependencies": {
"core-js": {
"version": "1.2.7",
"resolved": "http://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz",
"integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY="
},
"fbjs": {

View File

@ -43,7 +43,7 @@
"buffer": "^5.2.1",
"buffer-reverse": "^1.0.1",
"crypto-js": "^3.1.9-1",
"dayjs": "^1.7.8",
"dayjs": "^1.8.0",
"eslint-config-prettier": "^2.10.0",
"eslint-config-standard": "^12.0.0",
"eslint-config-standard-react": "^7.0.2",
@ -82,7 +82,7 @@
"react-native-sortable-list": "0.0.22",
"react-native-svg": "^8.0.10",
"react-native-vector-icons": "^6.0.2",
"react-native-webview": "2.8.0",
"react-native-webview": "^3.1.2",
"react-navigation": "^3.0.9",
"react-test-render": "^1.1.1",
"readable-stream": "^1.1.14",

View File

@ -35,6 +35,7 @@ export default class LNDCreateInvoice extends Component {
this.props.navigation.navigate('LNDViewInvoice', {
invoice: invoiceRequest,
fromWallet: this.state.fromWallet,
isModal: true,
});
} catch (_error) {
ReactNativeHapticFeedback.trigger('notificationError', false);

View File

@ -10,7 +10,7 @@ const loc = require('../../loc');
export default class LNDViewAdditionalInvoiceInformation extends Component {
static navigationOptions = ({ navigation }) => ({
...BlueNavigationStyle(navigation, true, () => navigation.dismiss()),
...BlueNavigationStyle(),
title: 'Additional Information',
});

View File

@ -12,11 +12,14 @@ const QRFast = require('react-native-qrcode');
const { width, height } = Dimensions.get('window');
export default class LNDViewInvoice extends Component {
static navigationOptions = ({ navigation }) => ({
static navigationOptions = ({ navigation }) =>
navigation.getParam('isModal') === true
? {
...BlueNavigationStyle(navigation, true, () => navigation.dismiss()),
title: 'Lightning Invoice',
headerLeft: null,
});
}
: { ...BlueNavigationStyle(), title: 'Lightning Invoice' };
constructor(props) {
super(props);

View File

@ -430,6 +430,7 @@ export default class WalletsList extends Component {
this.props.navigation.navigate('LNDViewInvoice', {
invoice: rowData.item,
fromWallet: lightningWallet[0],
isModal: false,
});
}
}}

View File

@ -544,9 +544,10 @@ export default class WalletTransactions extends Component {
rowData.item.type === 'payment_request' ||
rowData.item.type === 'paid_invoice'
) {
this.props.navigation.navigate('LNDViewExistingInvoice', {
this.props.navigation.navigate('LNDViewInvoice', {
invoice: rowData.item,
fromWallet: this.state.wallet,
isModal: false,
});
}
}}