1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00

Merge pull request #6695 from MetaMask/develop

Develop to master
This commit is contained in:
Dan Finlay 2019-06-06 12:07:54 -07:00 committed by GitHub
commit 141a9a50ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 64 deletions

View File

@ -2,6 +2,10 @@
## Current Develop Branch ## 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 ## 6.6.0 Mon Jun 03 2019
- [#6659](https://github.com/MetaMask/metamask-extension/pull/6659): Enable Ledger hardware wallet support on Firefox - [#6659](https://github.com/MetaMask/metamask-extension/pull/6659): Enable Ledger hardware wallet support on Firefox

View File

@ -1,7 +1,7 @@
{ {
"name": "__MSG_appName__", "name": "__MSG_appName__",
"short_name": "__MSG_appName__", "short_name": "__MSG_appName__",
"version": "6.6.0", "version": "6.6.1",
"manifest_version": 2, "manifest_version": 2,
"author": "https://metamask.io", "author": "https://metamask.io",
"description": "__MSG_appDescription__", "description": "__MSG_appDescription__",

View File

@ -41,15 +41,12 @@ EnsInput.prototype.onChange = function (recipient) {
ensResolution: null, ensResolution: null,
ensFailure: null, ensFailure: null,
toError: null, toError: null,
recipient,
}) })
} }
this.setState({ this.setState({
loadingEns: true, loadingEns: true,
recipient,
}) })
this.checkName(recipient) this.checkName(recipient)
} }
@ -59,7 +56,6 @@ EnsInput.prototype.render = function () {
list: 'addresses', list: 'addresses',
onChange: this.onChange.bind(this), onChange: this.onChange.bind(this),
qrScanner: true, qrScanner: true,
recipient: (this.state || {}).recipient,
}) })
return h('div', { return h('div', {
style: { width: '100%', position: 'relative' }, style: { width: '100%', position: 'relative' },
@ -83,21 +79,19 @@ EnsInput.prototype.componentDidMount = function () {
EnsInput.prototype.lookupEnsName = function (recipient) { EnsInput.prototype.lookupEnsName = function (recipient) {
const { ensResolution } = this.state const { ensResolution } = this.state
recipient = recipient.trim()
log.info(`ENS attempting to resolve name: ${recipient}`) log.info(`ENS attempting to resolve name: ${recipient}`)
this.ens.lookup(recipient) this.ens.lookup(recipient.trim())
.then((address) => { .then((address) => {
if (address === ZERO_ADDRESS) throw new Error(this.context.t('noAddressForName')) if (address === ZERO_ADDRESS) throw new Error(this.context.t('noAddressForName'))
if (address !== ensResolution) { if (address !== ensResolution) {
this.setState({ this.setState({
loadingEns: false, loadingEns: false,
ensResolution: address, ensResolution: address,
nickname: recipient, nickname: recipient.trim(),
hoverText: address + '\n' + this.context.t('clickCopy'), hoverText: address + '\n' + this.context.t('clickCopy'),
ensFailure: false, ensFailure: false,
toError: null, toError: null,
recipient,
}) })
} }
}) })
@ -107,11 +101,11 @@ EnsInput.prototype.lookupEnsName = function (recipient) {
ensResolution: recipient, ensResolution: recipient,
ensFailure: true, ensFailure: true,
toError: null, toError: null,
recipient: null,
} }
if (isValidENSAddress(recipient) && reason.message === 'ENS name not defined.') { if (isValidENSAddress(recipient) && reason.message === 'ENS name not defined.') {
setStateObj.hoverText = this.context.t('ensNameNotFound') setStateObj.hoverText = this.context.t('ensNameNotFound')
setStateObj.toError = 'ensNameNotFound' setStateObj.toError = 'ensNameNotFound'
setStateObj.ensFailure = false
} else { } else {
log.error(reason) log.error(reason)
setStateObj.hoverText = reason.message setStateObj.hoverText = reason.message
@ -134,7 +128,7 @@ EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) {
} }
if (prevState && ensResolution && this.props.onChange && if (prevState && ensResolution && this.props.onChange &&
ensResolution !== prevState.ensResolution) { 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 })
} }
} }

View File

@ -773,43 +773,7 @@
} }
} }
&__to-autocomplete { &__to-autocomplete, &__memo-text-area, &__hex-data {
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 {
&__input { &__input {
z-index: 1025; z-index: 1025;
position: relative; position: relative;

View File

@ -1,7 +1,6 @@
const Component = require('react').Component const Component = require('react').Component
const PropTypes = require('prop-types') const PropTypes = require('prop-types')
const h = require('react-hyperscript') const h = require('react-hyperscript')
const copyToClipboard = require('copy-to-clipboard')
const inherits = require('util').inherits const inherits = require('util').inherits
const AccountListItem = require('../account-list-item/account-list-item.component').default const AccountListItem = require('../account-list-item/account-list-item.component').default
const connect = require('react-redux').connect const connect = require('react-redux').connect
@ -94,34 +93,24 @@ ToAutoComplete.prototype.componentDidUpdate = function (nextProps) {
ToAutoComplete.prototype.render = function () { ToAutoComplete.prototype.render = function () {
const { const {
to, to,
recipient,
dropdownOpen, dropdownOpen,
onChange, onChange,
inError, inError,
qrScanner, qrScanner,
} = this.props } = this.props
const isRecipientToDiff = recipient && recipient !== to return h('div.send-v2__to-autocomplete', {}, [
return h('div.send-v2__to-autocomplete', {style: {
borderColor: inError ? 'red' : null,
}}, [
h(`input.send-v2__to-autocomplete__input${qrScanner ? '.with-qr' : ''}`, { h(`input.send-v2__to-autocomplete__input${qrScanner ? '.with-qr' : ''}`, {
placeholder: this.context.t('recipientAddress'), placeholder: this.context.t('recipientAddress'),
className: inError ? `send-v2__error-border` : '', className: inError ? `send-v2__error-border` : '',
value: recipient, value: to,
onChange: event => onChange(event.target.value), onChange: event => onChange(event.target.value),
onFocus: event => this.handleInputEvent(event), 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, { qrScanner && h(Tooltip, {
title: this.context.t('scanQrCode'), title: this.context.t('scanQrCode'),
position: 'bottom', position: 'bottom',