From c9a1a5325a09f17bef519ac84c00597ec3cfd7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Thu, 21 Feb 2019 23:55:57 -0500 Subject: [PATCH] ADD: Electrum setting placeholder --- MainBottomTabs.js | 5 ++ loc/en.js | 2 +- screen/settings/electrumSettings.js | 76 +++++++++++++++++++++++++++++ screen/settings/settings.js | 14 ++++-- 4 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 screen/settings/electrumSettings.js diff --git a/MainBottomTabs.js b/MainBottomTabs.js index a147cde3..35c30c84 100644 --- a/MainBottomTabs.js +++ b/MainBottomTabs.js @@ -9,6 +9,7 @@ import Currency from './screen/settings/currency'; import EncryptStorage from './screen/settings/encryptStorage'; import PlausibleDeniability from './screen/plausibledeniability'; import LightningSettings from './screen/settings/lightningSettings'; +import ElectrumSettings from './screen/settings/electrumSettings'; import WalletsList from './screen/wallets/list'; import WalletTransactions from './screen/wallets/transactions'; import AddWallet from './screen/wallets/add'; @@ -110,6 +111,10 @@ const WalletsStackNavigator = createStackNavigator( screen: LightningSettings, path: 'LightningSettings', }, + ElectrumSettings: { + screen: ElectrumSettings, + path: 'ElectrumSettings', + }, LNDViewInvoice: { screen: LNDViewInvoice, swipeEnabled: false, diff --git a/loc/en.js b/loc/en.js index 41582c70..20c6c7c6 100644 --- a/loc/en.js +++ b/loc/en.js @@ -179,7 +179,7 @@ module.exports = { retype_password: 'Re-type password', passwords_do_not_match: 'Passwords do not match', encrypt_storage: 'Encrypt storage', - lightning_settings: 'Lightning Settings', + lightning_settings: 'Lightning', lightning_settings_explain: 'To connect to your own LND node please install LndHub' + ' and put its URL here in settings. Leave blank to use default LndHub (lndhub.io)', diff --git a/screen/settings/electrumSettings.js b/screen/settings/electrumSettings.js new file mode 100644 index 00000000..1f9ad14a --- /dev/null +++ b/screen/settings/electrumSettings.js @@ -0,0 +1,76 @@ +import React, { Component } from 'react'; +import { FlatList, TouchableOpacity } from 'react-native'; +import { BlueLoading, BlueText, SafeBlueArea, BlueListItem, BlueCard, BlueNavigationStyle } from '../../BlueComponents'; +import PropTypes from 'prop-types'; +import { Icon } from 'react-native-elements'; +let loc = require('../../loc'); + +export default class Electrum extends Component { + static navigationOptions = () => ({ + ...BlueNavigationStyle(), + title: 'Electrum', + }); + + constructor(props) { + super(props); + this.state = { + isLoading: true, + } +} + + async componentDidMount() { + this.setState({ + isLoading: false, + }); + } + + renderItem = ({ item }) => { + return ( + { + console.log('setLanguage', item.value); + loc.setLanguage(item.value); + loc.saveLanguage(item.value); + return this.setState({ language: item.value }); + }} + > + , + } + : { hideChevron: true })} + /> + + ); + }; + + render() { + if (this.state.isLoading) { + return ; + } + + return ( + + `${index}`} + data={this.state.availableLanguages} + extraData={this.state.availableLanguages} + renderItem={this.renderItem} + /> + + When selecting a new language, restarting BlueWallet may be required for the change to take effect. + + + ); + } +} + +Electrum.propTypes = { + navigation: PropTypes.shape({ + navigate: PropTypes.func, + goBack: PropTypes.func, + }), +}; diff --git a/screen/settings/settings.js b/screen/settings/settings.js index 7fef9644..4aefaa4a 100644 --- a/screen/settings/settings.js +++ b/screen/settings/settings.js @@ -33,14 +33,11 @@ export default class Settings extends Component { return ( - - + + this.props.navigation.navigate('EncryptStorage')}> - this.props.navigation.navigate('LightningSettings')}> - - this.props.navigation.navigate('Language')}> @@ -50,6 +47,13 @@ export default class Settings extends Component { this.props.navigation.navigate('About')}> + + this.props.navigation.navigate('LightningSettings')}> + + + this.props.navigation.navigate('ElectrumSettings')}> + + );