|
|
|
@ -1,7 +1,6 @@ |
|
|
|
|
const Component = require('react').Component |
|
|
|
|
const h = require('react-hyperscript') |
|
|
|
|
const inherits = require('util').inherits |
|
|
|
|
const extend = require('xtend') |
|
|
|
|
const debounce = require('debounce') |
|
|
|
|
const copyToClipboard = require('copy-to-clipboard') |
|
|
|
|
const ENS = require('ethjs-ens') |
|
|
|
@ -20,9 +19,8 @@ function EnsInput () { |
|
|
|
|
|
|
|
|
|
EnsInput.prototype.render = function () { |
|
|
|
|
const props = this.props |
|
|
|
|
const opts = extend(props, { |
|
|
|
|
list: 'addresses', |
|
|
|
|
onChange: () => { |
|
|
|
|
|
|
|
|
|
function onInputChange() { |
|
|
|
|
const network = this.props.network |
|
|
|
|
const networkHasEnsSupport = getNetworkEnsSupport(network) |
|
|
|
|
if (!networkHasEnsSupport) return |
|
|
|
@ -40,12 +38,18 @@ EnsInput.prototype.render = function () { |
|
|
|
|
loadingEns: true, |
|
|
|
|
}) |
|
|
|
|
this.checkName() |
|
|
|
|
}, |
|
|
|
|
}) |
|
|
|
|
return h('div', { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
h('div', { |
|
|
|
|
style: { width: '100%' }, |
|
|
|
|
}, [ |
|
|
|
|
h('input.large-input', opts), |
|
|
|
|
h('input.large-input', { |
|
|
|
|
name: props.name, |
|
|
|
|
placeholder: props.placeholder, |
|
|
|
|
list: 'addresses', |
|
|
|
|
onChange: onInputChange.bind(this), |
|
|
|
|
}), |
|
|
|
|
// The address book functionality.
|
|
|
|
|
h('datalist#addresses', |
|
|
|
|
[ |
|
|
|
@ -69,6 +73,7 @@ EnsInput.prototype.render = function () { |
|
|
|
|
]), |
|
|
|
|
this.ensIcon(), |
|
|
|
|
]) |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EnsInput.prototype.componentDidMount = function () { |
|
|
|
|