From 9180e39b080c4294100b2165039f7f88225f8001 Mon Sep 17 00:00:00 2001 From: Jenny Pollack Date: Thu, 6 Jun 2019 19:20:33 +0200 Subject: [PATCH 1/2] Revert "fixed #5524" This reverts commit c8cb4ba3705478a16cd1e39f8edc1f277bb2ede6. --- ui/app/components/app/ens-input.js | 14 ++----- ui/app/css/itcss/components/send.scss | 38 +------------------ .../send/to-autocomplete/to-autocomplete.js | 21 +++------- 3 files changed, 10 insertions(+), 63 deletions(-) diff --git a/ui/app/components/app/ens-input.js b/ui/app/components/app/ens-input.js index f17f6c3d6..5eea0dd90 100644 --- a/ui/app/components/app/ens-input.js +++ b/ui/app/components/app/ens-input.js @@ -41,15 +41,12 @@ EnsInput.prototype.onChange = function (recipient) { ensResolution: null, ensFailure: null, toError: null, - recipient, }) } this.setState({ loadingEns: true, - recipient, }) - this.checkName(recipient) } @@ -59,7 +56,6 @@ EnsInput.prototype.render = function () { list: 'addresses', onChange: this.onChange.bind(this), qrScanner: true, - recipient: (this.state || {}).recipient, }) return h('div', { style: { width: '100%', position: 'relative' }, @@ -83,21 +79,19 @@ EnsInput.prototype.componentDidMount = function () { EnsInput.prototype.lookupEnsName = function (recipient) { const { ensResolution } = this.state - recipient = recipient.trim() log.info(`ENS attempting to resolve name: ${recipient}`) - this.ens.lookup(recipient) + this.ens.lookup(recipient.trim()) .then((address) => { if (address === ZERO_ADDRESS) throw new Error(this.context.t('noAddressForName')) if (address !== ensResolution) { this.setState({ loadingEns: false, ensResolution: address, - nickname: recipient, + nickname: recipient.trim(), hoverText: address + '\n' + this.context.t('clickCopy'), ensFailure: false, toError: null, - recipient, }) } }) @@ -107,11 +101,11 @@ EnsInput.prototype.lookupEnsName = function (recipient) { ensResolution: recipient, ensFailure: true, toError: null, - recipient: null, } if (isValidENSAddress(recipient) && reason.message === 'ENS name not defined.') { setStateObj.hoverText = this.context.t('ensNameNotFound') setStateObj.toError = 'ensNameNotFound' + setStateObj.ensFailure = false } else { log.error(reason) setStateObj.hoverText = reason.message @@ -134,7 +128,7 @@ EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) { } if (prevState && ensResolution && this.props.onChange && ensResolution !== prevState.ensResolution) { - this.props.onChange({ toAddress: ensResolution, recipient: state.recipient, nickname, toError: state.toError, toWarning: state.toWarning }) + this.props.onChange({ toAddress: ensResolution, nickname, toError: state.toError, toWarning: state.toWarning }) } } diff --git a/ui/app/css/itcss/components/send.scss b/ui/app/css/itcss/components/send.scss index e2f0f9b2f..c1a7381b6 100644 --- a/ui/app/css/itcss/components/send.scss +++ b/ui/app/css/itcss/components/send.scss @@ -773,43 +773,7 @@ } } - &__to-autocomplete { - display: flex; - flex-direction: column; - z-index: 1025; - position: relative; - height: 54px; - width: 100%; - border: 1px solid $alto; - border-radius: 4px; - background-color: $white; - color: $tundora; - padding: 0 10px; - font-family: Roboto; - line-height: 21px; - - &__input { - font-size: 16px; - height: 100%; - border: none; - } - - &__resolved { - font-size: 12px; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - height: 30px; - cursor: pointer; - - + .send-v2__to-autocomplete__qr-code { - top: 2px; - right: 0; - } - } - } - - &__memo-text-area, &__hex-data { + &__to-autocomplete, &__memo-text-area, &__hex-data { &__input { z-index: 1025; position: relative; diff --git a/ui/app/pages/send/to-autocomplete/to-autocomplete.js b/ui/app/pages/send/to-autocomplete/to-autocomplete.js index 11f86acf3..328a5b62b 100644 --- a/ui/app/pages/send/to-autocomplete/to-autocomplete.js +++ b/ui/app/pages/send/to-autocomplete/to-autocomplete.js @@ -1,7 +1,6 @@ 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 @@ -94,34 +93,24 @@ ToAutoComplete.prototype.componentDidUpdate = function (nextProps) { ToAutoComplete.prototype.render = function () { const { to, - recipient, dropdownOpen, onChange, inError, qrScanner, } = this.props - const isRecipientToDiff = recipient && recipient !== to - - return h('div.send-v2__to-autocomplete', {style: { - borderColor: inError ? 'red' : null, - }}, [ + return h('div.send-v2__to-autocomplete', {}, [ h(`input.send-v2__to-autocomplete__input${qrScanner ? '.with-qr' : ''}`, { placeholder: this.context.t('recipientAddress'), className: inError ? `send-v2__error-border` : '', - value: recipient, + value: to, 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', From 94efbfaa1c3953270feb67d598e0694bb7568174 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 6 Jun 2019 10:37:50 -0700 Subject: [PATCH 2/2] Version 6.6.1 RC1 --- CHANGELOG.md | 4 ++++ app/manifest.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b96648380..d7f7baddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Current Develop Branch +## 6.6.1 Thu Jun 06 2019 + +- [#6691](https://github.com/MetaMask/metamask-extension/pull/6691): Revert "Improve ENS Address Input" to fix bugs on input field on non-main networks. + ## 6.6.0 Mon Jun 03 2019 - [#6659](https://github.com/MetaMask/metamask-extension/pull/6659): Enable Ledger hardware wallet support on Firefox diff --git a/app/manifest.json b/app/manifest.json index 0dbd09b65..6acb74082 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_appName__", "short_name": "__MSG_appName__", - "version": "6.6.0", + "version": "6.6.1", "manifest_version": 2, "author": "https://metamask.io", "description": "__MSG_appDescription__",