Browse Source

FIX: Disable Clear button if no text is inserted

shakedebug
Marcos Rodriguez 5 years ago
committed by Overtorment
parent
commit
73b135d69d
  1. 12
      screen/wallets/import.js

12
screen/wallets/import.js

@ -271,24 +271,24 @@ export default class WalletsImport extends Component {
> >
<BlueButton <BlueButton
disabled={this.state.isLoading} disabled={this.state.isLoading}
title="Clear" title="Paste Clipboard"
buttonStyle={{ buttonStyle={{
width: width / 1.5, width: width / 1.5,
}} }}
onPress={async () => { onPress={async () => {
this.setState({ label: '' }); const clipboard = await Clipboard.getString();
this.setState({ label: clipboard }, () => Keyboard.dismiss());
}} }}
/> />
<BlueSpacing20 /> <BlueSpacing20 />
<BlueButton <BlueButton
disabled={this.state.isLoading} disabled={this.state.isLoading || this.state.label.length <= 0}
title="Paste Clipboard" title="Clear"
buttonStyle={{ buttonStyle={{
width: width / 1.5, width: width / 1.5,
}} }}
onPress={async () => { onPress={async () => {
const clipboard = await Clipboard.getString(); this.setState({ label: '' });
this.setState({ label: clipboard }, () => Keyboard.dismiss());
}} }}
/> />
<BlueSpacing20 /> <BlueSpacing20 />

Loading…
Cancel
Save