"Scan lnurl" -> "Scan to receive"

This commit is contained in:
fiatjaf 2019-08-03 09:27:09 -03:00 committed by Overtorment
parent 3ed6a7a63f
commit 538688e7d7
25 changed files with 43 additions and 34 deletions

View file

@ -1702,33 +1702,6 @@ export class BlueAddressInput extends Component {
} }
} }
export class BlueReadQR extends Component {
static propTypes = {
suffix: PropTypes.string,
onBarScanned: PropTypes.func,
};
render() {
return (
<TouchableOpacity
onPress={() => NavigationService.navigate('ScanQrAddress', { onBarScanned: this.props.onBarScanned }) }
style={{
flex: 1,
flexDirection: 'row',
minWidth: width,
justifyContent: 'center',
alignItems: 'center'
}}
>
<Icon name="qrcode" type="font-awesome" color={BlueApp.settings.buttonTextColor} containerStyle={{ marginRight: 8 }} />
<Text style={{color: BlueApp.settings.buttonTextColor, textAlign: 'center'}}>
{loc.send.details.scan} {this.props.suffix}
</Text>
</TouchableOpacity>
);
}
}
export class BlueBitcoinAmount extends Component { export class BlueBitcoinAmount extends Component {
static propTypes = { static propTypes = {
isLoading: PropTypes.bool, isLoading: PropTypes.bool,

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Přijmout částku...', setAmount: 'Přijmout částku...',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Koupit Bitcoin', header: 'Koupit Bitcoin',

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Modtag med beløb', setAmount: 'Modtag med beløb',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Køb Bitcoin', header: 'Køb Bitcoin',

View file

@ -167,6 +167,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Zu erhaltender Betrag', setAmount: 'Zu erhaltender Betrag',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Kaufe Bitcoin', header: 'Kaufe Bitcoin',

View file

@ -168,6 +168,7 @@ module.exports = {
create: 'Δημιούργησε', create: 'Δημιούργησε',
setAmount: 'Λάβε με ποσό', setAmount: 'Λάβε με ποσό',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Αγόρασε Bitcoin', header: 'Αγόρασε Bitcoin',

View file

@ -166,6 +166,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Receive with amount', setAmount: 'Receive with amount',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Buy Bitcoin', header: 'Buy Bitcoin',

View file

@ -167,6 +167,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Receive with amount', setAmount: 'Receive with amount',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Buy Bitcoin', header: 'Buy Bitcoin',

View file

@ -168,6 +168,7 @@ module.exports = {
create: 'Luo', create: 'Luo',
setAmount: 'Vastaanotettava summa', setAmount: 'Vastaanotettava summa',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Osta Bitcoinia', header: 'Osta Bitcoinia',

View file

@ -167,6 +167,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Revevoir avec montant', setAmount: 'Revevoir avec montant',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Acheter du Bitcoin', header: 'Acheter du Bitcoin',

View file

@ -163,6 +163,7 @@ module.exports = {
create: 'Stvori', create: 'Stvori',
setAmount: 'Odredi iznos za primiti', setAmount: 'Odredi iznos za primiti',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Kupovina Bitcoina', header: 'Kupovina Bitcoina',

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'Létrehoz', create: 'Létrehoz',
setAmount: 'Fogadandó összeg', setAmount: 'Fogadandó összeg',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Bitcoin vásárlása', header: 'Bitcoin vásárlása',

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'Buat', create: 'Buat',
setAmount: 'Terima sejumlah', setAmount: 'Terima sejumlah',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Beli bitcoin', header: 'Beli bitcoin',

View file

@ -168,6 +168,7 @@ module.exports = {
create: 'Crea', create: 'Crea',
setAmount: 'Ricevi con importo', setAmount: 'Ricevi con importo',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Compra Bitcoin', header: 'Compra Bitcoin',

View file

@ -165,6 +165,7 @@ module.exports = {
create: '作成', create: '作成',
setAmount: '入金額', setAmount: '入金額',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Bitcoin の購入', header: 'Bitcoin の購入',

View file

@ -166,6 +166,7 @@ module.exports = {
create: 'Lag', create: 'Lag',
setAmount: 'Motta med beløp', setAmount: 'Motta med beløp',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Kjøp Bitcoin', header: 'Kjøp Bitcoin',

View file

@ -166,6 +166,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Ontvang met bedrag', setAmount: 'Ontvang met bedrag',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Koop Bitcoin', header: 'Koop Bitcoin',

View file

@ -169,6 +169,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Valor a receber', setAmount: 'Valor a receber',
}, },
scan_lnurl: 'Receber lendo QR'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Comprar Bitcoin', header: 'Comprar Bitcoin',

View file

@ -172,6 +172,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Receive with amount', setAmount: 'Receive with amount',
}, },
scan_lnurl: 'Receber lendo QR'
}, },
settings: { settings: {
tabBarLabel: 'Definições', tabBarLabel: 'Definições',

View file

@ -171,6 +171,7 @@ module.exports = {
create: 'Создать', create: 'Создать',
setAmount: 'Получить сумму', setAmount: 'Получить сумму',
}, },
scan_lnurl: 'Scan to receive'
}, },
settings: { settings: {
tabBarLabel: 'Настройки', tabBarLabel: 'Настройки',

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'Skapa', create: 'Skapa',
setAmount: 'Ta emot med belopp', setAmount: 'Ta emot med belopp',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Köp bitcoin', header: 'Köp bitcoin',

View file

@ -165,6 +165,7 @@ module.exports = {
create: 'สร้าง', create: 'สร้าง',
setAmount: 'รับด้วยจำนวน', setAmount: 'รับด้วยจำนวน',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'ซื้อบิตคอยน์', header: 'ซื้อบิตคอยน์',

View file

@ -166,6 +166,7 @@ module.exports = {
create: 'Oluştur', create: 'Oluştur',
setAmount: 'Miktar ile al', setAmount: 'Miktar ile al',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Bitcoin Satın al', header: 'Bitcoin Satın al',

View file

@ -166,6 +166,7 @@ module.exports = {
create: 'Create', create: 'Create',
setAmount: 'Receive with amount', setAmount: 'Receive with amount',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: 'Buy Bitcoin', header: 'Buy Bitcoin',

View file

@ -163,6 +163,7 @@ module.exports = {
create: '创建', create: '创建',
setAmount: '收款金额', setAmount: '收款金额',
}, },
scan_lnurl: 'Scan to receive'
}, },
buyBitcoin: { buyBitcoin: {
header: '购买比特币', header: '购买比特币',

View file

@ -1,13 +1,16 @@
/* global alert */ /* global alert */
import React, { Component } from 'react'; import React, { Component } from 'react';
import { ActivityIndicator, View, TextInput, KeyboardAvoidingView, Keyboard, TouchableWithoutFeedback, Text } from 'react-native'; import { Dimensions, ActivityIndicator, View, TextInput, KeyboardAvoidingView, Keyboard, TouchableWithoutFeedback, TouchableOpacity, Text } from 'react-native';
import { BlueNavigationStyle, BlueButton, BlueReadQR, BlueBitcoinAmount, BlueDismissKeyboardInputAccessory } from '../../BlueComponents'; import { BlueNavigationStyle, BlueButton, BlueBitcoinAmount, BlueDismissKeyboardInputAccessory } from '../../BlueComponents';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import bech32 from 'bech32'; import bech32 from 'bech32';
import { BitcoinUnit } from '../../models/bitcoinUnits'; import { BitcoinUnit } from '../../models/bitcoinUnits';
import NavigationService from '../../NavigationService';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
let BlueApp = require('../../BlueApp');
let EV = require('../../events'); let EV = require('../../events');
let loc = require('../../loc'); let loc = require('../../loc');
const { width } = Dimensions.get('window');
export default class LNDCreateInvoice extends Component { export default class LNDCreateInvoice extends Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
@ -108,7 +111,7 @@ export default class LNDCreateInvoice extends Component {
k1: reply.k1, k1: reply.k1,
callback: reply.callback, callback: reply.callback,
fixed: reply.minWithdrawable === reply.maxWithdrawable, fixed: reply.minWithdrawable === reply.maxWithdrawable,
min: reply.minWithdrawable / 1000, min: (reply.minWithdrawable || 0) / 1000,
max: reply.maxWithdrawable / 1000 max: reply.maxWithdrawable / 1000
}, },
amount: (reply.maxWithdrawable / 1000).toString(), amount: (reply.maxWithdrawable / 1000).toString(),
@ -138,10 +141,20 @@ export default class LNDCreateInvoice extends Component {
renderScanClickable = () => { renderScanClickable = () => {
return ( return (
<View style={{ marginHorizontal: 0, marginVertical: 16, minHeight: 25, alignContent: 'center' }}> <View style={{ marginHorizontal: 0, marginVertical: 16, minHeight: 25, alignContent: 'center' }}>
<BlueReadQR <TouchableOpacity
onBarScanned={this.processLnurl} onPress={() => NavigationService.navigate('ScanQrAddress', { onBarScanned: this.processLnurl }) }
suffix="lnurl" style={{
/> flex: 1,
flexDirection: 'row',
minWidth: width,
justifyContent: 'center',
alignItems: 'center'
}}
>
<Text style={{color: BlueApp.settings.buttonTextColor, textAlign: 'center'}}>
{loc.receive.scan_lnurl}
</Text>
</TouchableOpacity>
</View> </View>
); );
}; };