diff options
author | Alex Ivasyuv <industral@gmail.com> | 2019-05-15 03:00:53 +0800 |
---|---|---|
committer | Alex Ivasyuv <industral@gmail.com> | 2019-05-15 03:00:53 +0800 |
commit | c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6 (patch) | |
tree | e22e1efce0f018ebd4bf36037790ff92cf535ee5 /ui/app/pages | |
parent | 3b01ba8741543d54bd2c3aad6a8ea0ef352e8924 (diff) | |
download | tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.gz tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.bz2 tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.lz tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.xz tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.tar.zst tangerine-wallet-browser-c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6.zip |
fixed #5524
Diffstat (limited to 'ui/app/pages')
-rw-r--r-- | ui/app/pages/send/to-autocomplete/to-autocomplete.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/ui/app/pages/send/to-autocomplete/to-autocomplete.js b/ui/app/pages/send/to-autocomplete/to-autocomplete.js index 328a5b62b..11f86acf3 100644 --- a/ui/app/pages/send/to-autocomplete/to-autocomplete.js +++ b/ui/app/pages/send/to-autocomplete/to-autocomplete.js @@ -1,6 +1,7 @@ const Component = require('react').Component const PropTypes = require('prop-types') const h = require('react-hyperscript') +const copyToClipboard = require('copy-to-clipboard') const inherits = require('util').inherits const AccountListItem = require('../account-list-item/account-list-item.component').default const connect = require('react-redux').connect @@ -93,24 +94,34 @@ ToAutoComplete.prototype.componentDidUpdate = function (nextProps) { ToAutoComplete.prototype.render = function () { const { to, + recipient, dropdownOpen, onChange, inError, qrScanner, } = this.props - return h('div.send-v2__to-autocomplete', {}, [ + const isRecipientToDiff = recipient && recipient !== to + + return h('div.send-v2__to-autocomplete', {style: { + borderColor: inError ? 'red' : null, + }}, [ h(`input.send-v2__to-autocomplete__input${qrScanner ? '.with-qr' : ''}`, { placeholder: this.context.t('recipientAddress'), className: inError ? `send-v2__error-border` : '', - value: to, + value: recipient, onChange: event => onChange(event.target.value), onFocus: event => this.handleInputEvent(event), - style: { - borderColor: inError ? 'red' : null, - }, }), + isRecipientToDiff && h(Tooltip, {title: this.context.t('copyToClipboard')}, + h('div.send-v2__to-autocomplete__resolved', { + onClick: (event) => { + event.preventDefault() + event.stopPropagation() + copyToClipboard(to) + }, + }, to)), qrScanner && h(Tooltip, { title: this.context.t('scanQrCode'), position: 'bottom', |