Merge pull request #588 from lbryio/wallet-send-paste
add paste button beside wallet address input
This commit is contained in:
commit
aa285f90ae
6 changed files with 29 additions and 18 deletions
|
@ -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);
|
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
|
@ -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]}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -865,14 +865,15 @@ class FilePage extends React.PureComponent {
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
<View style={filePageStyle.subscriptionRow}>
|
<View style={filePageStyle.subscriptionRow}>
|
||||||
{false && ((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && (
|
{false &&
|
||||||
<Button
|
((isPlayable && !fileInfo) || (isPlayable && fileInfo && !fileInfo.download_path)) && (
|
||||||
style={[filePageStyle.actionButton, filePageStyle.saveFileButton]}
|
<Button
|
||||||
theme={'light'}
|
style={[filePageStyle.actionButton, filePageStyle.saveFileButton]}
|
||||||
icon={'download'}
|
theme={'light'}
|
||||||
onPress={this.onSaveFilePressed}
|
icon={'download'}
|
||||||
/>
|
onPress={this.onSaveFilePressed}
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
style={[filePageStyle.actionButton, filePageStyle.tipButton]}
|
style={[filePageStyle.actionButton, filePageStyle.tipButton]}
|
||||||
theme={'light'}
|
theme={'light'}
|
||||||
|
|
|
@ -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 />
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue