2018-12-25 17:34:51 +01:00
|
|
|
import React, { Component } from 'react';
|
2020-07-15 19:32:59 +02:00
|
|
|
import { View, Text, Dimensions, StatusBar, ScrollView, BackHandler, TouchableOpacity, StyleSheet } from 'react-native';
|
2019-08-06 06:20:33 +02:00
|
|
|
import Share from 'react-native-share';
|
2019-01-22 17:17:45 +01:00
|
|
|
import {
|
|
|
|
BlueLoading,
|
|
|
|
BlueText,
|
|
|
|
SafeBlueArea,
|
|
|
|
BlueButton,
|
2020-07-15 19:32:59 +02:00
|
|
|
SecondButton,
|
2019-01-22 17:17:45 +01:00
|
|
|
BlueCopyTextToClipboard,
|
|
|
|
BlueNavigationStyle,
|
|
|
|
BlueSpacing20,
|
2020-04-29 16:00:33 +02:00
|
|
|
BlueBigCheckmark,
|
2019-01-22 17:17:45 +01:00
|
|
|
} from '../../BlueComponents';
|
2018-12-25 17:34:51 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-12-27 07:12:19 +01:00
|
|
|
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
2018-12-30 16:34:13 +01:00
|
|
|
import { Icon } from 'react-native-elements';
|
2019-02-14 06:15:56 +01:00
|
|
|
import QRCode from 'react-native-qrcode-svg';
|
2020-07-20 15:38:46 +02:00
|
|
|
import loc from '../../loc';
|
2020-07-15 19:32:59 +02:00
|
|
|
import { BlueCurrentTheme } from '../../components/themes';
|
2020-10-24 19:20:59 +02:00
|
|
|
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
2019-01-05 02:28:08 +01:00
|
|
|
const { width, height } = Dimensions.get('window');
|
2018-12-25 17:34:51 +01:00
|
|
|
|
2020-05-24 11:17:26 +02:00
|
|
|
const styles = StyleSheet.create({
|
|
|
|
root: {
|
|
|
|
flex: 1,
|
2020-07-16 19:41:20 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.background,
|
2020-05-24 11:17:26 +02:00
|
|
|
},
|
|
|
|
center: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
2020-08-03 19:26:16 +02:00
|
|
|
qrCodeContainer: { borderWidth: 6, borderRadius: 8, borderColor: '#FFFFFF' },
|
2020-05-24 11:17:26 +02:00
|
|
|
valueRoot: {
|
|
|
|
flex: 2,
|
|
|
|
flexDirection: 'column',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
|
|
|
valueAmount: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
justifyContent: 'center',
|
|
|
|
paddingBottom: 8,
|
|
|
|
},
|
|
|
|
valueText: {
|
2020-07-15 19:32:59 +02:00
|
|
|
color: BlueCurrentTheme.colors.alternativeTextColor2,
|
2020-05-24 11:17:26 +02:00
|
|
|
fontSize: 32,
|
|
|
|
fontWeight: '600',
|
|
|
|
},
|
|
|
|
valueSats: {
|
2020-07-15 19:32:59 +02:00
|
|
|
color: BlueCurrentTheme.colors.alternativeTextColor2,
|
2020-05-24 11:17:26 +02:00
|
|
|
fontSize: 16,
|
|
|
|
marginHorizontal: 4,
|
|
|
|
paddingBottom: 3,
|
|
|
|
fontWeight: '600',
|
|
|
|
alignSelf: 'flex-end',
|
|
|
|
},
|
|
|
|
memo: {
|
|
|
|
color: '#9aa0aa',
|
|
|
|
fontSize: 14,
|
|
|
|
marginHorizontal: 4,
|
|
|
|
paddingBottom: 6,
|
|
|
|
fontWeight: '400',
|
|
|
|
alignSelf: 'center',
|
|
|
|
},
|
|
|
|
paid: {
|
|
|
|
flex: 3,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
|
|
|
paidMark: {
|
|
|
|
marginTop: -100,
|
|
|
|
marginBottom: 16,
|
2020-07-15 19:32:59 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.success,
|
2020-05-24 11:17:26 +02:00
|
|
|
},
|
|
|
|
detailsRoot: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'flex-end',
|
|
|
|
marginBottom: 24,
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
detailsTouch: {
|
|
|
|
flexDirection: 'row',
|
|
|
|
alignItems: 'center',
|
|
|
|
},
|
|
|
|
detailsText: {
|
2020-07-15 19:32:59 +02:00
|
|
|
color: BlueCurrentTheme.colors.alternativeTextColor,
|
2020-05-24 11:17:26 +02:00
|
|
|
fontSize: 14,
|
|
|
|
marginRight: 8,
|
|
|
|
},
|
|
|
|
expired: {
|
2020-07-15 19:32:59 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.success,
|
2020-05-24 11:17:26 +02:00
|
|
|
width: 120,
|
|
|
|
height: 120,
|
|
|
|
borderRadius: 60,
|
|
|
|
alignSelf: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
marginTop: -100,
|
|
|
|
marginBottom: 30,
|
|
|
|
},
|
|
|
|
activeRoot: {
|
|
|
|
flex: 1,
|
|
|
|
alignItems: 'center',
|
|
|
|
marginTop: 8,
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
},
|
|
|
|
activeQrcode: {
|
|
|
|
flex: 1,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
2020-08-05 02:28:37 +02:00
|
|
|
marginHorizontal: 16,
|
2020-08-03 19:26:16 +02:00
|
|
|
borderWidth: 6,
|
|
|
|
borderRadius: 8,
|
|
|
|
borderColor: '#FFFFFF',
|
2020-05-24 11:17:26 +02:00
|
|
|
},
|
|
|
|
additionalInfo: {
|
2020-07-15 19:32:59 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.brandingColor,
|
2020-05-24 11:17:26 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2018-12-25 17:34:51 +01:00
|
|
|
export default class LNDViewInvoice extends Component {
|
2020-10-24 19:20:59 +02:00
|
|
|
static contextType = BlueStorageContext;
|
2018-12-25 17:34:51 +01:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
2020-05-27 13:12:17 +02:00
|
|
|
const invoice = props.route.params.invoice;
|
|
|
|
const fromWallet = props.route.params.fromWallet;
|
2018-12-25 17:34:51 +01:00
|
|
|
this.state = {
|
|
|
|
invoice,
|
2018-12-27 07:12:19 +01:00
|
|
|
fromWallet,
|
2018-12-28 01:26:46 +01:00
|
|
|
isLoading: typeof invoice === 'string',
|
2020-06-01 14:54:23 +02:00
|
|
|
addressText: typeof invoice === 'object' && 'payment_request' in invoice ? invoice.payment_request : invoice,
|
2018-12-30 16:34:13 +01:00
|
|
|
isFetchingInvoices: true,
|
2019-01-11 15:52:03 +01:00
|
|
|
qrCodeHeight: height > width ? width - 20 : width / 2,
|
2018-12-25 17:34:51 +01:00
|
|
|
};
|
2018-12-27 07:12:19 +01:00
|
|
|
this.fetchInvoiceInterval = undefined;
|
2019-08-30 06:14:06 +02:00
|
|
|
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
|
2018-12-27 07:12:19 +01:00
|
|
|
}
|
|
|
|
|
2020-01-08 11:58:30 +01:00
|
|
|
componentDidMount() {
|
2020-11-15 19:19:55 +01:00
|
|
|
this.context.setSelectedWallet(this.state.fromWallet.getID());
|
2020-08-10 16:17:50 +02:00
|
|
|
console.log('LNDViewInvoice - componentDidMount');
|
2018-12-28 00:33:39 +01:00
|
|
|
this.fetchInvoiceInterval = setInterval(async () => {
|
2018-12-30 16:34:13 +01:00
|
|
|
if (this.state.isFetchingInvoices) {
|
2018-12-28 01:26:46 +01:00
|
|
|
try {
|
2019-01-10 18:50:33 +01:00
|
|
|
const userInvoices = await this.state.fromWallet.getUserInvoices(20);
|
|
|
|
// fetching only last 20 invoices
|
|
|
|
// for invoice that was created just now - that should be enough (it is basically the last one, so limit=1 would be sufficient)
|
|
|
|
// but that might not work as intended IF user creates 21 invoices, and then tries to check the status of invoice #0, it just wont be updated
|
|
|
|
const updatedUserInvoice = userInvoices.filter(invoice =>
|
2018-12-28 01:26:46 +01:00
|
|
|
typeof this.state.invoice === 'object'
|
|
|
|
? invoice.payment_request === this.state.invoice.payment_request
|
|
|
|
: invoice.payment_request === this.state.invoice,
|
|
|
|
)[0];
|
2019-01-03 02:10:16 +01:00
|
|
|
if (typeof updatedUserInvoice !== 'undefined') {
|
|
|
|
this.setState({ invoice: updatedUserInvoice, isLoading: false, addressText: updatedUserInvoice.payment_request });
|
|
|
|
if (updatedUserInvoice.ispaid) {
|
|
|
|
// we fetched the invoice, and it is paid :-)
|
2018-12-28 01:26:46 +01:00
|
|
|
this.setState({ isFetchingInvoices: false });
|
2019-05-03 14:36:11 +02:00
|
|
|
ReactNativeHapticFeedback.trigger('notificationSuccess', { ignoreAndroidSystemSettings: false });
|
2018-12-28 01:26:46 +01:00
|
|
|
clearInterval(this.fetchInvoiceInterval);
|
|
|
|
this.fetchInvoiceInterval = undefined;
|
2020-10-24 19:20:59 +02:00
|
|
|
this.context.fetchAndSaveWalletTransactions(this.state.fromWallet.getID());
|
2019-01-03 02:10:16 +01:00
|
|
|
} else {
|
|
|
|
const currentDate = new Date();
|
|
|
|
const now = (currentDate.getTime() / 1000) | 0;
|
|
|
|
const invoiceExpiration = updatedUserInvoice.timestamp + updatedUserInvoice.expire_time;
|
|
|
|
if (invoiceExpiration < now && !updatedUserInvoice.ispaid) {
|
|
|
|
// invoice expired :-(
|
2020-10-24 19:20:59 +02:00
|
|
|
this.context.fetchAndSaveWalletTransactions(this.state.fromWallet.getID());
|
2019-01-03 02:10:16 +01:00
|
|
|
this.setState({ isFetchingInvoices: false });
|
2019-05-03 14:36:11 +02:00
|
|
|
ReactNativeHapticFeedback.trigger('notificationError', { ignoreAndroidSystemSettings: false });
|
2019-01-03 02:10:16 +01:00
|
|
|
clearInterval(this.fetchInvoiceInterval);
|
|
|
|
this.fetchInvoiceInterval = undefined;
|
|
|
|
}
|
2018-12-28 01:26:46 +01:00
|
|
|
}
|
2018-12-28 00:40:55 +01:00
|
|
|
}
|
2018-12-28 01:26:46 +01:00
|
|
|
} catch (error) {
|
|
|
|
console.log(error);
|
2018-12-28 00:40:55 +01:00
|
|
|
}
|
2018-12-28 00:33:39 +01:00
|
|
|
}
|
2019-01-01 01:09:10 +01:00
|
|
|
}, 3000);
|
2018-12-27 07:12:19 +01:00
|
|
|
}
|
|
|
|
|
2019-08-25 08:13:41 +02:00
|
|
|
async componentWillUnmount() {
|
2018-12-27 16:12:22 +01:00
|
|
|
clearInterval(this.fetchInvoiceInterval);
|
2018-12-28 00:33:39 +01:00
|
|
|
this.fetchInvoiceInterval = undefined;
|
2019-08-30 06:14:06 +02:00
|
|
|
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton);
|
2019-01-12 00:01:52 +01:00
|
|
|
}
|
|
|
|
|
2019-08-30 06:14:06 +02:00
|
|
|
handleBackButton = () => {
|
2019-02-16 07:12:14 +01:00
|
|
|
this.props.navigation.goBack(null);
|
2019-01-12 00:01:52 +01:00
|
|
|
return true;
|
2019-08-30 06:14:06 +02:00
|
|
|
};
|
2018-12-25 17:34:51 +01:00
|
|
|
|
2019-01-05 02:28:08 +01:00
|
|
|
onLayout = () => {
|
|
|
|
const { height } = Dimensions.get('window');
|
2019-01-11 15:52:03 +01:00
|
|
|
this.setState({ qrCodeHeight: height > width ? width - 20 : width / 2 });
|
2019-01-05 02:28:08 +01:00
|
|
|
};
|
|
|
|
|
2018-12-25 17:34:51 +01:00
|
|
|
render() {
|
|
|
|
if (this.state.isLoading) {
|
2020-07-17 16:07:09 +02:00
|
|
|
return (
|
|
|
|
<View style={styles.root}>
|
|
|
|
<BlueLoading />
|
|
|
|
</View>
|
2020-07-23 20:04:44 +02:00
|
|
|
);
|
2018-12-25 17:34:51 +01:00
|
|
|
}
|
|
|
|
|
2018-12-27 07:12:19 +01:00
|
|
|
const { invoice } = this.state;
|
|
|
|
if (typeof invoice === 'object') {
|
|
|
|
const currentDate = new Date();
|
|
|
|
const now = (currentDate.getTime() / 1000) | 0;
|
|
|
|
const invoiceExpiration = invoice.timestamp + invoice.expire_time;
|
|
|
|
|
2019-05-04 00:24:17 +02:00
|
|
|
if (this.state.showPreimageQr) {
|
|
|
|
return (
|
2020-05-24 11:17:26 +02:00
|
|
|
<SafeBlueArea style={styles.root}>
|
2020-07-15 19:32:59 +02:00
|
|
|
<StatusBar barStyle="default" />
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.center}>
|
2020-07-20 15:38:46 +02:00
|
|
|
<BlueText>{loc.lndViewInvoice.preimage}:</BlueText>
|
2019-05-04 00:24:17 +02:00
|
|
|
<BlueSpacing20 />
|
2020-08-03 19:26:16 +02:00
|
|
|
<View style={styles.qrCodeContainer}>
|
|
|
|
<QRCode
|
|
|
|
value={invoice.payment_preimage && typeof invoice.payment_preimage === 'string' ? invoice.payment_preimage : 'none'}
|
|
|
|
logo={require('../../img/qr-code.png')}
|
|
|
|
size={this.state.qrCodeHeight}
|
|
|
|
logoSize={90}
|
|
|
|
color="#000000"
|
|
|
|
logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
|
|
|
|
backgroundColor="#FFFFFF"
|
|
|
|
/>
|
|
|
|
</View>
|
2019-05-04 00:24:17 +02:00
|
|
|
<BlueSpacing20 />
|
2020-05-09 22:37:57 +02:00
|
|
|
<BlueCopyTextToClipboard
|
|
|
|
text={invoice.payment_preimage && typeof invoice.payment_preimage === 'string' ? invoice.payment_preimage : 'none'}
|
|
|
|
/>
|
2019-05-04 00:24:17 +02:00
|
|
|
</View>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-01-01 23:31:42 +01:00
|
|
|
if (invoice.ispaid || invoice.type === 'paid_invoice') {
|
2018-12-27 07:12:19 +01:00
|
|
|
return (
|
2020-05-24 11:17:26 +02:00
|
|
|
<SafeBlueArea style={styles.root}>
|
2020-07-15 19:32:59 +02:00
|
|
|
<StatusBar barStyle="default" />
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.valueRoot}>
|
2019-11-19 15:49:09 +01:00
|
|
|
{invoice.type === 'paid_invoice' && invoice.value && (
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.valueAmount}>
|
|
|
|
<Text style={styles.valueText}>{invoice.value}</Text>
|
|
|
|
<Text style={styles.valueSats}>{loc.lndViewInvoice.sats}</Text>
|
2019-11-06 18:01:09 +01:00
|
|
|
</View>
|
|
|
|
)}
|
2019-11-19 15:49:09 +01:00
|
|
|
{invoice.type === 'user_invoice' && invoice.amt && (
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.valueAmount}>
|
|
|
|
<Text style={styles.valueText}>{invoice.amt}</Text>
|
|
|
|
<Text style={styles.valueSats}>{loc.lndViewInvoice.sats}</Text>
|
2019-11-06 18:01:09 +01:00
|
|
|
</View>
|
|
|
|
)}
|
2020-05-24 11:17:26 +02:00
|
|
|
{!invoice.ispaid && invoice.memo && invoice.memo.length > 0 && <Text style={styles.memo}>{invoice.memo}</Text>}
|
2019-11-19 15:49:09 +01:00
|
|
|
</View>
|
2019-11-06 18:01:09 +01:00
|
|
|
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.paid}>
|
|
|
|
<BlueBigCheckmark style={styles.paidMark} />
|
2019-05-04 00:58:23 +02:00
|
|
|
<BlueText>{loc.lndViewInvoice.has_been_paid}</BlueText>
|
2019-11-06 18:01:09 +01:00
|
|
|
</View>
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.detailsRoot}>
|
2020-05-09 22:37:57 +02:00
|
|
|
{invoice.payment_preimage && typeof invoice.payment_preimage === 'string' ? (
|
2020-05-24 11:17:26 +02:00
|
|
|
<TouchableOpacity style={styles.detailsTouch} onPress={() => this.setState({ showPreimageQr: true })}>
|
2020-07-23 20:04:44 +02:00
|
|
|
<Text style={styles.detailsText}>{loc.send.create_details}</Text>
|
2020-07-15 19:32:59 +02:00
|
|
|
<Icon name="angle-right" size={18} type="font-awesome" color={BlueCurrentTheme.colors.alternativeTextColor} />
|
2019-11-06 18:01:09 +01:00
|
|
|
</TouchableOpacity>
|
2020-05-09 22:37:57 +02:00
|
|
|
) : (
|
|
|
|
<View />
|
2019-05-04 00:24:17 +02:00
|
|
|
)}
|
2018-12-27 07:12:19 +01:00
|
|
|
</View>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
if (invoiceExpiration < now && !invoice.ispaid) {
|
|
|
|
return (
|
2020-05-24 11:17:26 +02:00
|
|
|
<SafeBlueArea style={styles.root}>
|
2020-07-15 19:32:59 +02:00
|
|
|
<StatusBar barStyle="default" />
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.center}>
|
|
|
|
<View style={styles.expired}>
|
2020-07-15 19:32:59 +02:00
|
|
|
<Icon name="times" size={50} type="font-awesome" color={BlueCurrentTheme.colors.successCheck} />
|
2019-01-01 23:31:42 +01:00
|
|
|
</View>
|
2019-05-04 00:58:23 +02:00
|
|
|
<BlueText>{loc.lndViewInvoice.wasnt_paid_and_expired}</BlueText>
|
2018-12-27 07:12:19 +01:00
|
|
|
</View>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
} else if (invoiceExpiration > now && invoice.ispaid) {
|
|
|
|
if (invoice.ispaid) {
|
|
|
|
return (
|
2020-05-24 11:17:26 +02:00
|
|
|
<SafeBlueArea style={styles.root}>
|
|
|
|
<View style={styles.center}>
|
2019-05-04 00:58:23 +02:00
|
|
|
<BlueText>{loc.lndViewInvoice.has_been_paid}</BlueText>
|
2018-12-27 07:12:19 +01:00
|
|
|
</View>
|
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Invoice has not expired, nor has it been paid for.
|
2018-12-25 17:34:51 +01:00
|
|
|
return (
|
2019-01-03 02:05:53 +01:00
|
|
|
<SafeBlueArea>
|
2020-07-15 19:32:59 +02:00
|
|
|
<StatusBar barStyle="default" />
|
2019-01-11 15:52:03 +01:00
|
|
|
<ScrollView>
|
2020-05-24 11:17:26 +02:00
|
|
|
<View style={styles.activeRoot} onLayout={this.onLayout}>
|
|
|
|
<View style={styles.activeQrcode}>
|
2019-02-14 06:15:56 +01:00
|
|
|
<QRCode
|
2019-01-11 15:52:03 +01:00
|
|
|
value={typeof this.state.invoice === 'object' ? invoice.payment_request : invoice}
|
2019-02-14 06:15:56 +01:00
|
|
|
logo={require('../../img/qr-code.png')}
|
2019-01-11 15:52:03 +01:00
|
|
|
size={this.state.qrCodeHeight}
|
2019-02-14 06:15:56 +01:00
|
|
|
logoSize={90}
|
2020-08-03 19:26:16 +02:00
|
|
|
color="#000000"
|
2020-07-15 19:32:59 +02:00
|
|
|
logoBackgroundColor={BlueCurrentTheme.colors.brandingColor}
|
2020-08-03 19:26:16 +02:00
|
|
|
backgroundColor="#FFFFFF"
|
2019-01-11 15:52:03 +01:00
|
|
|
/>
|
|
|
|
</View>
|
|
|
|
|
|
|
|
<BlueSpacing20 />
|
2020-01-08 11:58:30 +01:00
|
|
|
<BlueText>
|
|
|
|
{loc.lndViewInvoice.please_pay} {invoice.amt} {loc.lndViewInvoice.sats}
|
|
|
|
</BlueText>
|
2020-06-01 14:54:23 +02:00
|
|
|
{invoice && 'description' in invoice && invoice.description.length > 0 && (
|
2019-05-04 00:58:23 +02:00
|
|
|
<BlueText>
|
|
|
|
{loc.lndViewInvoice.for} {invoice.description}
|
|
|
|
</BlueText>
|
2019-01-26 00:32:35 +01:00
|
|
|
)}
|
2019-01-22 17:17:45 +01:00
|
|
|
<BlueCopyTextToClipboard text={this.state.invoice.payment_request} />
|
2019-01-11 15:52:03 +01:00
|
|
|
|
2020-07-15 19:32:59 +02:00
|
|
|
<SecondButton
|
2020-07-06 23:53:08 +02:00
|
|
|
onPress={() => {
|
2020-07-15 19:32:59 +02:00
|
|
|
Share.open({ message: `lightning:${invoice.payment_request}` }).catch(error => console.log(error));
|
2019-01-11 15:52:03 +01:00
|
|
|
}}
|
2020-07-20 15:38:46 +02:00
|
|
|
title={loc.receive.details_share}
|
2019-01-11 15:52:03 +01:00
|
|
|
/>
|
2019-01-26 00:32:35 +01:00
|
|
|
<BlueSpacing20 />
|
2019-05-22 14:09:00 +02:00
|
|
|
<BlueButton
|
2020-05-24 11:17:26 +02:00
|
|
|
style={styles.additionalInfo}
|
2019-01-11 15:52:03 +01:00
|
|
|
onPress={() => this.props.navigation.navigate('LNDViewAdditionalInvoiceInformation', { fromWallet: this.state.fromWallet })}
|
2019-05-04 00:58:23 +02:00
|
|
|
title={loc.lndViewInvoice.additional_info}
|
2019-01-01 23:31:42 +01:00
|
|
|
/>
|
2018-12-25 17:34:51 +01:00
|
|
|
</View>
|
2019-01-03 02:05:53 +01:00
|
|
|
<BlueSpacing20 />
|
2019-01-11 15:52:03 +01:00
|
|
|
</ScrollView>
|
2018-12-25 17:34:51 +01:00
|
|
|
</SafeBlueArea>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LNDViewInvoice.propTypes = {
|
|
|
|
navigation: PropTypes.shape({
|
2019-02-01 16:28:43 +01:00
|
|
|
goBack: PropTypes.func,
|
|
|
|
navigate: PropTypes.func,
|
2019-02-15 00:41:02 +01:00
|
|
|
popToTop: PropTypes.func,
|
2018-12-25 17:34:51 +01:00
|
|
|
}),
|
2020-05-27 13:12:17 +02:00
|
|
|
route: PropTypes.shape({
|
|
|
|
params: PropTypes.object,
|
|
|
|
}),
|
2018-12-25 17:34:51 +01:00
|
|
|
};
|
2020-07-15 19:32:59 +02:00
|
|
|
|
|
|
|
LNDViewInvoice.navigationOptions = ({ navigation, route }) =>
|
|
|
|
route.params.isModal === true
|
|
|
|
? {
|
|
|
|
...BlueNavigationStyle(navigation, true, () => navigation.dangerouslyGetParent().pop()),
|
|
|
|
title: 'Lightning Invoice',
|
|
|
|
headerLeft: null,
|
|
|
|
headerStyle: {
|
2020-11-22 09:48:16 +01:00
|
|
|
...BlueNavigationStyle().headerStyle,
|
2020-07-15 19:32:59 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.customHeader,
|
|
|
|
},
|
2020-11-22 09:48:16 +01:00
|
|
|
gestureEnabled: false,
|
2020-07-15 19:32:59 +02:00
|
|
|
}
|
|
|
|
: {
|
|
|
|
...BlueNavigationStyle(),
|
|
|
|
title: 'Lightning Invoice',
|
|
|
|
headerStyle: {
|
2020-11-22 09:48:16 +01:00
|
|
|
...BlueNavigationStyle().headerStyle,
|
2020-07-15 19:32:59 +02:00
|
|
|
backgroundColor: BlueCurrentTheme.colors.customHeader,
|
|
|
|
},
|
|
|
|
};
|