From df3e488dea7be7853ccf157585c6f0a614e4ba7a Mon Sep 17 00:00:00 2001 From: ncoelho Date: Tue, 27 Apr 2021 18:19:36 +0200 Subject: [PATCH] REF: Electrum Server view elements --- BlueComponents.js | 2 +- loc/en.json | 6 ++-- screen/settings/electrumSettings.js | 46 ++++++++++++++++------------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 2418739e3..a919349b2 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -885,7 +885,7 @@ export const BlueDoneAndDismissKeyboardInputAccessory = props => { export const BlueLoading = props => { return ( - + ); diff --git a/loc/en.json b/loc/en.json index 1d81bc7b7..f564f4c23 100644 --- a/loc/en.json +++ b/loc/en.json @@ -257,14 +257,14 @@ "electrum_connected": "Connected", "electrum_connected_not": "Not Connected", "electrum_error_connect": "Can’t connect to the provided Electrum server", - "electrum_host": "Host, for example, {example}", + "electrum_host": "E.g. {example}", "electrum_port": "TCP port, usually {example}", "electrum_port_ssl": "SSL port, usually {example}", "electrum_saved": "Your changes have been saved successfully. Restarting BlueWallet may be required for the changes to take effect.", "set_electrum_server_as_default": "Set {server} as the default Electrum server?", "set_lndhub_as_default": "Set {url} as the default LNDHub server?", - "electrum_settings_server": "Electrum Server Settings", - "electrum_settings_explain": "Leave blank to use the default settings.", + "electrum_settings_server": "Electrum Server", + "electrum_settings_explain": "Leave blank to use the default.", "electrum_status": "Status", "electrum_clear_alert_title": "Clear history?", "electrum_clear_alert_message": "Do you want to clear electrum servers history?", diff --git a/screen/settings/electrumSettings.js b/screen/settings/electrumSettings.js index c6449dc12..9a1bc54f8 100644 --- a/screen/settings/electrumSettings.js +++ b/screen/settings/electrumSettings.js @@ -1,7 +1,7 @@ /* global alert */ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { Alert, View, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; +import { Text, Alert, View, TextInput, TouchableOpacity, StyleSheet } from 'react-native'; import DefaultPreference from 'react-native-default-preference'; import RNWidgetCenter from 'react-native-widget-center'; import AsyncStorage from '@react-native-async-storage/async-storage'; @@ -204,10 +204,10 @@ export default class ElectrumSettings extends Component { const serverHistoryItems = this.state.serverHistory.map((server, i) => { return ( - - {`${server.host}:${server.port || server.sslPort}`} - - this.selectServer(server)}> + + {`${server.host}:${server.port || server.sslPort}`} + + this.selectServer(server)}> {loc.settings.electrum_select} @@ -233,18 +233,10 @@ export default class ElectrumSettings extends Component { {this.state.config.host}:{this.state.config.port} - - - {loc.settings.electrum_settings_explain} - this.resetToDefault()}> - {loc.settings.electrum_reset} - - - this.setState({ host: text.trim() })} numberOfLines={1} @@ -289,11 +281,17 @@ export default class ElectrumSettings extends Component { testID="SSLPortInput" /> - {loc.settings.tor_supported} + + {loc.settings.electrum_settings_explain} + this.resetToDefault()}> + {loc.settings.electrum_reset} + + + + {this.state.isLoading ? : } - {this.state.isLoading ? : } {serverHistoryItems.length > 0 && !this.state.isLoading && ( @@ -392,6 +390,7 @@ const styles = StyleSheet.create({ serverAddTitle: { flexDirection: 'row', justifyContent: 'space-between', + marginVertical: 16, }, serverHistoryTitle: { flexDirection: 'row', @@ -400,12 +399,19 @@ const styles = StyleSheet.create({ }, serverHistoryItem: { flexDirection: 'row', - justifyContent: 'space-between', paddingVertical: 20, borderBottomColor: BlueCurrentTheme.colors.formBorder, - borderBottomWidth: 1, + borderBottomWidth: .5, + flexWrap: 'nowrap', }, - torSupported: { - color: '#81868e', + serverRow: { + flexGrow: 2, + maxWidth: '80%', + color: BlueCurrentTheme.colors.foregroundColor, + }, + selectButton: { + flexGrow: 1, + marginLeft: 16, + alignItems: 'flex-end', }, });