Browse Source

ADD: Copy from clipboard on actionsheet

fiatinpt
marcosrdz 5 years ago
committed by Overtorment
parent
commit
e579cb4685
  1. 13
      screen/wallets/transactions.js

13
screen/wallets/transactions.js

@ -17,6 +17,7 @@ import {
Linking,
KeyboardAvoidingView,
Alert,
Clipboard,
} from 'react-native';
import PropTypes from 'prop-types';
import { NavigationEvents } from 'react-navigation';
@ -496,10 +497,14 @@ export default class WalletTransactions extends Component {
);
};
copyFromClipbard = async () => {
this.onBarCodeRead({ data: await Clipboard.getString() });
};
sendButtonLongPress = () => {
if (Platform.OS === 'ios') {
ActionSheet.showActionSheetWithOptions(
{ options: [loc.send.details.cancel, 'Choose Photo', 'Scan QR Code'], cancelButtonIndex: 0 },
{ options: [loc.send.details.cancel, 'Choose Photo', 'Scan QR Code', 'Copy from Clipboard'], cancelButtonIndex: 0 },
buttonIndex => {
if (buttonIndex === 1) {
this.choosePhoto();
@ -509,6 +514,8 @@ export default class WalletTransactions extends Component {
onBarScanned: this.onBarCodeRead,
showFileImportButton: false,
});
} else if (buttonIndex === 3) {
this.copyFromClipbard();
}
},
);
@ -535,6 +542,10 @@ export default class WalletTransactions extends Component {
showFileImportButton: false,
}),
},
{
text: 'Copy From Clipboard',
onPress: this.copyFromClipbard,
},
],
});
}

Loading…
Cancel
Save