This commit is contained in:
Overtorment 2019-01-12 02:08:03 +00:00
parent 45526c01e9
commit 7e2846fb64
3 changed files with 9 additions and 5 deletions

View file

@ -1,10 +1,11 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { View, Alert } from 'react-native'; import { View, Alert, Dimensions } from 'react-native';
import { WebView } from 'react-native-webview'; import { WebView } from 'react-native-webview';
import { BlueNavigationStyle } from '../../BlueComponents'; import { BlueNavigationStyle } from '../../BlueComponents';
import { FormInput } from 'react-native-elements'; import { FormInput } from 'react-native-elements';
import Ionicons from 'react-native-vector-icons/Ionicons'; import Ionicons from 'react-native-vector-icons/Ionicons';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const { width } = Dimensions.get('window');
export default class Browser extends Component { export default class Browser extends Component {
static navigationOptions = ({ navigation }) => ({ static navigationOptions = ({ navigation }) => ({
@ -15,6 +16,8 @@ export default class Browser extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
if (!props.navigation.getParam('fromSecret')) throw new Error('Invalid param');
this.state = { url: '' }; this.state = { url: '' };
} }
@ -31,16 +34,15 @@ export default class Browser extends Component {
style={{ style={{
color: 'red', color: 'red',
backgroundColor: 'transparent', backgroundColor: 'transparent',
minWidth:36,
paddingLeft:10,
left: 8, left: 8,
top: 1, top: 1,
}} }}
/> />
<FormInput <FormInput
inputStyle={{ color: '#0c2550', maxWidth: 300, fontSize: 16 }} inputStyle={{ color: '#0c2550', fontSize: 16 }}
containerStyle={{ containerStyle={{
maxWidth: width - 100,
borderColor: '#d2d2d2', borderColor: '#d2d2d2',
borderWidth: 0.5, borderWidth: 0.5,
backgroundColor: '#f5f5f5', backgroundColor: '#f5f5f5',
@ -170,6 +172,7 @@ export default class Browser extends Component {
Browser.propTypes = { Browser.propTypes = {
navigation: PropTypes.shape({ navigation: PropTypes.shape({
getParam: PropTypes.function,
navigate: PropTypes.func, navigate: PropTypes.func,
}), }),
}; };

View file

@ -18,6 +18,7 @@ export default class ManageFunds extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.onWalletSelect = this.onWalletSelect.bind(this); this.onWalletSelect = this.onWalletSelect.bind(this);
if (!props.navigation.getParam('fromWallet')) throw new Error('Invalid param');
this.state = { fromWallet: props.navigation.getParam('fromWallet') }; this.state = { fromWallet: props.navigation.getParam('fromWallet') };
} }

View file

@ -390,7 +390,7 @@ export default class WalletTransactions extends Component {
style={{ alignSelf: 'flex-end', right: 10, top: -5, flexDirection: 'row' }} style={{ alignSelf: 'flex-end', right: 10, top: -5, flexDirection: 'row' }}
onPress={() => { onPress={() => {
console.log('navigating to', this.state.wallet.getLabel()); console.log('navigating to', this.state.wallet.getLabel());
navigate('ManageFunds', { fromSecret: this.state.wallet.getSecret() }); navigate('ManageFunds', { fromWallet: this.state.wallet });
}} }}
> >
<BlueText style={{ fontWeight: '600', fontSize: 16 }}>{loc.lnd.title}</BlueText> <BlueText style={{ fontWeight: '600', fontSize: 16 }}>{loc.lnd.title}</BlueText>