Merge pull request #588 from lbryio/wallet-send-paste

add paste button beside wallet address input
This commit is contained in:
Akinwale Ariwodola 2019-06-21 10:17:59 +01:00 committed by GitHub
commit aa285f90ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 18 deletions

View file

@ -1,7 +1,4 @@
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Button from './view'; import Button from './view';
export default connect( export default connect()(Button);
null,
null
)(Button);

View file

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { Text, TouchableOpacity } from 'react-native'; import { Text, TouchableOpacity } from 'react-native';
import buttonStyle from '../../styles/button'; import buttonStyle from 'styles/button';
import Colors from '../../styles/colors'; import Colors from 'styles/colors';
import Icon from 'react-native-vector-icons/FontAwesome5'; import Icon from 'react-native-vector-icons/FontAwesome5';
export default class Button extends React.PureComponent { export default class Button extends React.PureComponent {

View file

@ -1,9 +1,10 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import { regexAddress } from 'lbry-redux'; import { regexAddress } from 'lbry-redux';
import { Alert, TextInput, Text, View } from 'react-native'; import { Alert, Clipboard, TextInput, Text, View } from 'react-native';
import Button from '../button'; import Button from 'component/button';
import walletStyle from '../../styles/wallet'; import Colors from 'styles/colors';
import walletStyle from 'styles/wallet';
type DraftTransaction = { type DraftTransaction = {
address: string, address: string,
@ -99,10 +100,16 @@ class WalletSend extends React.PureComponent<Props> {
onBlur={this.handleAddressInputBlur} onBlur={this.handleAddressInputBlur}
onSubmitEditing={this.handleAddressInputSubmit} onSubmitEditing={this.handleAddressInputSubmit}
placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'} placeholder={'bbFxRyXXXXXXXXXXXZD8nE7XTLUxYnddTs'}
underlineColorAndroid={Colors.NextLbryGreen}
value={this.state.address} value={this.state.address}
returnKeyType={'next'} returnKeyType={'next'}
style={[walletStyle.input, walletStyle.addressInput, walletStyle.bottomMarginMedium]} style={[walletStyle.input, walletStyle.addressInput, walletStyle.bottomMarginMedium]}
/> />
<Button
icon={'paste'}
style={walletStyle.button}
onPress={() => Clipboard.getString().then(value => this.setState({ address: value, addressChanged: true }))}
/>
</View> </View>
<Text style={walletStyle.text}>Amount</Text> <Text style={walletStyle.text}>Amount</Text>
<View style={walletStyle.row}> <View style={walletStyle.row}>
@ -112,6 +119,7 @@ class WalletSend extends React.PureComponent<Props> {
onChangeText={value => this.setState({ amount: value })} onChangeText={value => this.setState({ amount: value })}
keyboardType={'numeric'} keyboardType={'numeric'}
placeholder={'0'} placeholder={'0'}
underlineColorAndroid={Colors.NextLbryGreen}
value={this.state.amount} value={this.state.amount}
style={[walletStyle.input, walletStyle.amountInput]} style={[walletStyle.input, walletStyle.amountInput]}
/> />

View file

@ -865,7 +865,8 @@ class FilePage extends React.PureComponent {
/> />
</View> </View>
<View style={filePageStyle.subscriptionRow}> <View style={filePageStyle.subscriptionRow}>
{false && ((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && ( {false &&
((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && (
<Button <Button
style={[filePageStyle.actionButton, filePageStyle.saveFileButton]} style={[filePageStyle.actionButton, filePageStyle.saveFileButton]}
theme={'light'} theme={'light'}

View file

@ -101,7 +101,11 @@ class WalletPage extends React.PureComponent {
return ( return (
<View style={walletStyle.container}> <View style={walletStyle.container}>
<UriBar navigation={navigation} /> <UriBar navigation={navigation} />
<ScrollView style={walletStyle.scrollContainer} keyboardShouldPersistTaps={'handled'}> <ScrollView
style={walletStyle.scrollContainer}
keyboardShouldPersistTaps={'handled'}
removeClippedSubviews={false}
>
<WalletSyncDriver navigation={navigation} /> <WalletSyncDriver navigation={navigation} />
{!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />} {!rewardsNotInterested && (!balance || balance === 0) && <WalletRewardsDriver navigation={navigation} />}
<WalletBalance /> <WalletBalance />

View file

@ -138,6 +138,7 @@ const walletStyle = StyleSheet.create({
flex: 1, flex: 1,
fontSize: 16, fontSize: 16,
letterSpacing: 1.5, letterSpacing: 1.5,
marginRight: 8,
}, },
warning: { warning: {
backgroundColor: Colors.Orange, backgroundColor: Colors.Orange,