From f3e35e7bbaec5d83c371a471df95e51149ccca13 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Sun, 4 Aug 2019 20:34:17 +0100 Subject: [PATCH] REF --- loc/cs_CZ.js | 2 +- loc/da_DK.js | 2 +- loc/de_DE.js | 2 +- loc/el.js | 2 +- loc/en.js | 2 +- loc/es.js | 2 +- loc/fi_FI.js | 2 +- loc/fr_FR.js | 2 +- loc/hr_HR.js | 2 +- loc/hu_HU.js | 2 +- loc/id_ID.js | 2 +- loc/it.js | 2 +- loc/jp_JP.js | 2 +- loc/nb_NO.js | 2 +- loc/nl_NL.js | 2 +- loc/pt_BR.js | 2 +- loc/pt_PT.js | 2 +- loc/ru.js | 2 +- loc/sv_SE.js | 2 +- loc/th_TH.js | 2 +- loc/tr_TR.js | 2 +- loc/ua.js | 2 +- loc/zh_cn.js | 2 +- package.json | 2 +- react-native.config.js | 2 +- screen/lnd/lndCreateInvoice.js | 40 ++++++++++++++++++++-------------- screen/wallets/transactions.js | 20 +---------------- 27 files changed, 50 insertions(+), 60 deletions(-) diff --git a/loc/cs_CZ.js b/loc/cs_CZ.js index 0115ecd87..55380caea 100644 --- a/loc/cs_CZ.js +++ b/loc/cs_CZ.js @@ -165,7 +165,7 @@ module.exports = { create: 'Create', setAmount: 'Přijmout částku...', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Koupit Bitcoin', diff --git a/loc/da_DK.js b/loc/da_DK.js index 7d7ccfa5c..efd91e478 100644 --- a/loc/da_DK.js +++ b/loc/da_DK.js @@ -165,7 +165,7 @@ module.exports = { create: 'Create', setAmount: 'Modtag med beløb', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Køb Bitcoin', diff --git a/loc/de_DE.js b/loc/de_DE.js index dbd9b7d03..058b8d7fb 100644 --- a/loc/de_DE.js +++ b/loc/de_DE.js @@ -167,7 +167,7 @@ module.exports = { create: 'Create', setAmount: 'Zu erhaltender Betrag', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Kaufe Bitcoin', diff --git a/loc/el.js b/loc/el.js index a1971e12c..a93c1f1a5 100644 --- a/loc/el.js +++ b/loc/el.js @@ -168,7 +168,7 @@ module.exports = { create: 'Δημιούργησε', setAmount: 'Λάβε με ποσό', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Αγόρασε Bitcoin', diff --git a/loc/en.js b/loc/en.js index 7cd40b4ab..ebeb2ba8a 100644 --- a/loc/en.js +++ b/loc/en.js @@ -166,7 +166,7 @@ module.exports = { create: 'Create', setAmount: 'Receive with amount', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Buy Bitcoin', diff --git a/loc/es.js b/loc/es.js index b077295d1..51f3eb657 100644 --- a/loc/es.js +++ b/loc/es.js @@ -167,7 +167,7 @@ module.exports = { create: 'Create', setAmount: 'Receive with amount', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Buy Bitcoin', diff --git a/loc/fi_FI.js b/loc/fi_FI.js index f24d48888..2d500a998 100644 --- a/loc/fi_FI.js +++ b/loc/fi_FI.js @@ -168,7 +168,7 @@ module.exports = { create: 'Luo', setAmount: 'Vastaanotettava summa', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Osta Bitcoinia', diff --git a/loc/fr_FR.js b/loc/fr_FR.js index 2061fb86d..a66c590a8 100644 --- a/loc/fr_FR.js +++ b/loc/fr_FR.js @@ -167,7 +167,7 @@ module.exports = { create: 'Create', setAmount: 'Revevoir avec montant', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Acheter du Bitcoin', diff --git a/loc/hr_HR.js b/loc/hr_HR.js index ad4be6bca..e30f55b61 100644 --- a/loc/hr_HR.js +++ b/loc/hr_HR.js @@ -163,7 +163,7 @@ module.exports = { create: 'Stvori', setAmount: 'Odredi iznos za primiti', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Kupovina Bitcoina', diff --git a/loc/hu_HU.js b/loc/hu_HU.js index 247e48e29..262baef47 100644 --- a/loc/hu_HU.js +++ b/loc/hu_HU.js @@ -165,7 +165,7 @@ module.exports = { create: 'Létrehoz', setAmount: 'Fogadandó összeg', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Bitcoin vásárlása', diff --git a/loc/id_ID.js b/loc/id_ID.js index 7e00ce7c5..5edb33eb6 100644 --- a/loc/id_ID.js +++ b/loc/id_ID.js @@ -165,7 +165,7 @@ module.exports = { create: 'Buat', setAmount: 'Terima sejumlah', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Beli bitcoin', diff --git a/loc/it.js b/loc/it.js index aea71d1db..ec8dbd1fb 100644 --- a/loc/it.js +++ b/loc/it.js @@ -168,7 +168,7 @@ module.exports = { create: 'Crea', setAmount: 'Ricevi con importo', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Compra Bitcoin', diff --git a/loc/jp_JP.js b/loc/jp_JP.js index 9a3cf86ce..f3ceec3b0 100644 --- a/loc/jp_JP.js +++ b/loc/jp_JP.js @@ -165,7 +165,7 @@ module.exports = { create: '作成', setAmount: '入金額', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Bitcoin の購入', diff --git a/loc/nb_NO.js b/loc/nb_NO.js index 6cf372562..e77bf1dff 100644 --- a/loc/nb_NO.js +++ b/loc/nb_NO.js @@ -166,7 +166,7 @@ module.exports = { create: 'Lag', setAmount: 'Motta med beløp', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Kjøp Bitcoin', diff --git a/loc/nl_NL.js b/loc/nl_NL.js index e82c38abc..6124c3ab4 100644 --- a/loc/nl_NL.js +++ b/loc/nl_NL.js @@ -166,7 +166,7 @@ module.exports = { create: 'Create', setAmount: 'Ontvang met bedrag', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Koop Bitcoin', diff --git a/loc/pt_BR.js b/loc/pt_BR.js index c96c7c3f5..ef2aca917 100644 --- a/loc/pt_BR.js +++ b/loc/pt_BR.js @@ -169,7 +169,7 @@ module.exports = { create: 'Create', setAmount: 'Valor a receber', }, - scan_lnurl: 'Receber lendo QR' + scan_lnurl: 'Receber lendo QR', }, buyBitcoin: { header: 'Comprar Bitcoin', diff --git a/loc/pt_PT.js b/loc/pt_PT.js index 83dbbdcc8..a621a51c9 100644 --- a/loc/pt_PT.js +++ b/loc/pt_PT.js @@ -172,7 +172,7 @@ module.exports = { create: 'Create', setAmount: 'Receive with amount', }, - scan_lnurl: 'Receber lendo QR' + scan_lnurl: 'Receber lendo QR', }, settings: { tabBarLabel: 'Definições', diff --git a/loc/ru.js b/loc/ru.js index a4badfcce..e57590cc6 100644 --- a/loc/ru.js +++ b/loc/ru.js @@ -171,7 +171,7 @@ module.exports = { create: 'Создать', setAmount: 'Получить сумму', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, settings: { tabBarLabel: 'Настройки', diff --git a/loc/sv_SE.js b/loc/sv_SE.js index 57de74da9..451a64545 100644 --- a/loc/sv_SE.js +++ b/loc/sv_SE.js @@ -165,7 +165,7 @@ module.exports = { create: 'Skapa', setAmount: 'Ta emot med belopp', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Köp bitcoin', diff --git a/loc/th_TH.js b/loc/th_TH.js index 154dd9dbd..95ca764ad 100644 --- a/loc/th_TH.js +++ b/loc/th_TH.js @@ -165,7 +165,7 @@ module.exports = { create: 'สร้าง', setAmount: 'รับด้วยจำนวน', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'ซื้อบิตคอยน์', diff --git a/loc/tr_TR.js b/loc/tr_TR.js index c2f85cdb9..ebb8e87a9 100644 --- a/loc/tr_TR.js +++ b/loc/tr_TR.js @@ -166,7 +166,7 @@ module.exports = { create: 'Oluştur', setAmount: 'Miktar ile al', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Bitcoin Satın al', diff --git a/loc/ua.js b/loc/ua.js index 2db9c5fc4..4b86e6c94 100644 --- a/loc/ua.js +++ b/loc/ua.js @@ -166,7 +166,7 @@ module.exports = { create: 'Create', setAmount: 'Receive with amount', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: 'Buy Bitcoin', diff --git a/loc/zh_cn.js b/loc/zh_cn.js index c9b9ce145..f6b2e4156 100755 --- a/loc/zh_cn.js +++ b/loc/zh_cn.js @@ -163,7 +163,7 @@ module.exports = { create: '创建', setAmount: '收款金额', }, - scan_lnurl: 'Scan to receive' + scan_lnurl: 'Scan to receive', }, buyBitcoin: { header: '购买比特币', diff --git a/package.json b/package.json index 0d1477328..969c3eaea 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "coinselect": "3.1.11", "crypto-js": "3.1.9-1", "dayjs": "1.8.14", - "electrum-client": "git+https://github.com/Overtorment/rn-electrum-client.git", + "electrum-client": "git+https://github.com/BlueWallet/rn-electrum-client.git", "eslint-config-prettier": "6.0.0", "eslint-config-standard": "12.0.0", "eslint-config-standard-react": "7.0.2", diff --git a/react-native.config.js b/react-native.config.js index 495d68020..daa0bcdb9 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -1,6 +1,6 @@ module.exports = { dependencies: { - 'appcenter': { + appcenter: { platforms: { android: null, // disable Android platform, other platforms will still autolink if provided }, diff --git a/screen/lnd/lndCreateInvoice.js b/screen/lnd/lndCreateInvoice.js index ea6dde0b8..ea0e0c5da 100644 --- a/screen/lnd/lndCreateInvoice.js +++ b/screen/lnd/lndCreateInvoice.js @@ -1,6 +1,16 @@ /* global alert */ import React, { Component } from 'react'; -import { Dimensions, ActivityIndicator, View, TextInput, KeyboardAvoidingView, Keyboard, TouchableWithoutFeedback, TouchableOpacity, Text } from 'react-native'; +import { + Dimensions, + ActivityIndicator, + View, + TextInput, + KeyboardAvoidingView, + Keyboard, + TouchableWithoutFeedback, + TouchableOpacity, + Text, +} from 'react-native'; import { BlueNavigationStyle, BlueButton, BlueBitcoinAmount, BlueDismissKeyboardInputAccessory } from '../../BlueComponents'; import PropTypes from 'prop-types'; import bech32 from 'bech32'; @@ -42,9 +52,9 @@ export default class LNDCreateInvoice extends Component { // send to lnurl-withdraw callback url if that exists if (this.state.lnurlParams) { - let {callback, k1} = this.state.lnurlParams; + let { callback, k1 } = this.state.lnurlParams; let callbackUrl = callback + (callback.indexOf('?') !== -1 ? '&' : '?') + 'k1=' + k1 + '&pr=' + invoiceRequest; - let resp = await fetch(callbackUrl, {method: 'GET'}); + let resp = await fetch(callbackUrl, { method: 'GET' }); if (resp.status >= 300) { let text = await resp.text(); throw new Error(text); @@ -91,9 +101,9 @@ export default class LNDCreateInvoice extends Component { // calling the url try { - let resp = await fetch(url, {method: 'GET'}) + let resp = await fetch(url, { method: 'GET' }); if (resp.status >= 300) { - throw new Error("Bad response from server"); + throw new Error('Bad response from server'); } let reply = await resp.json(); if (reply.status === 'ERROR') { @@ -112,7 +122,7 @@ export default class LNDCreateInvoice extends Component { callback: reply.callback, fixed: reply.minWithdrawable === reply.maxWithdrawable, min: (reply.minWithdrawable || 0) / 1000, - max: reply.maxWithdrawable / 1000 + max: reply.maxWithdrawable / 1000, }, amount: (reply.maxWithdrawable / 1000).toString(), description: reply.defaultDescription, @@ -124,7 +134,7 @@ export default class LNDCreateInvoice extends Component { alert(Err.message); } }); - } + }; renderCreateButton = () => { return ( @@ -142,18 +152,16 @@ export default class LNDCreateInvoice extends Component { return ( NavigationService.navigate('ScanQrAddress', { onBarScanned: this.processLnurl }) } + onPress={() => NavigationService.navigate('ScanQrAddress', { onBarScanned: this.processLnurl })} style={{ flex: 1, flexDirection: 'row', minWidth: width, justifyContent: 'center', - alignItems: 'center' + alignItems: 'center', }} > - - {loc.receive.scan_lnurl} - + {loc.receive.scan_lnurl} ); @@ -179,12 +187,12 @@ export default class LNDCreateInvoice extends Component { onChangeText={text => { if (this.state.lnurlParams) { // in this case we prevent the user from changing the amount to < min or > max - let {min, max} = this.state.lnurlParams; - let nextAmount = parseInt(text) + let { min, max } = this.state.lnurlParams; + let nextAmount = parseInt(text); if (nextAmount < min) { - text = min.toString() + text = min.toString(); } else if (nextAmount > max) { - text = max.toString() + text = max.toString(); } } diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 5a0ab8011..94926043c 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -1,16 +1,6 @@ /* global alert */ import React, { Component } from 'react'; -import { - Text, - View, - ActivityIndicator, - InteractionManager, - FlatList, - RefreshControl, - TouchableOpacity, - StatusBar, - StyleSheet, -} from 'react-native'; +import { Text, View, ActivityIndicator, InteractionManager, FlatList, RefreshControl, TouchableOpacity, StatusBar } from 'react-native'; import PropTypes from 'prop-types'; import { NavigationEvents } from 'react-navigation'; import { BlueSendButtonIcon, BlueReceiveButtonIcon, BlueTransactionListItem, BlueWalletNavigationHeader } from '../../BlueComponents'; @@ -392,11 +382,3 @@ WalletTransactions.propTypes = { setParams: PropTypes.func, }), }; - -const styles = StyleSheet.create({ - balance: { - flexDirection: 'row', - alignItems: 'center', - marginTop: 8, - }, -});