|
|
|
@ -1,6 +1,5 @@ |
|
|
|
|
import React, { Component } from 'react' |
|
|
|
|
const inherits = require('util').inherits |
|
|
|
|
const Component = require('react').Component |
|
|
|
|
const h = require('react-hyperscript') |
|
|
|
|
const PropTypes = require('prop-types') |
|
|
|
|
const connect = require('react-redux').connect |
|
|
|
|
import Select from 'react-select' |
|
|
|
@ -35,47 +34,44 @@ AccountImportSubview.prototype.render = function () { |
|
|
|
|
const { type } = state |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
h('div.new-account-import-form', [ |
|
|
|
|
|
|
|
|
|
h('.new-account-import-disclaimer', [ |
|
|
|
|
h('span', this.context.t('importAccountMsg')), |
|
|
|
|
h('span', { |
|
|
|
|
style: { |
|
|
|
|
<div className="new-account-import-form"> |
|
|
|
|
<div className="new-account-import-disclaimer"> |
|
|
|
|
<span>{this.context.t('importAccountMsg')}</span> |
|
|
|
|
<span |
|
|
|
|
style={{ |
|
|
|
|
cursor: 'pointer', |
|
|
|
|
textDecoration: 'underline', |
|
|
|
|
}, |
|
|
|
|
onClick: () => { |
|
|
|
|
}} |
|
|
|
|
onClick={() => { |
|
|
|
|
global.platform.openWindow({ |
|
|
|
|
url: 'https://metamask.zendesk.com/hc/en-us/articles/360015289932', |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
}, this.context.t('here')), |
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
h('div.new-account-import-form__select-section', [ |
|
|
|
|
|
|
|
|
|
h('div.new-account-import-form__select-label', this.context.t('selectType')), |
|
|
|
|
|
|
|
|
|
h(Select, { |
|
|
|
|
className: 'new-account-import-form__select', |
|
|
|
|
name: 'import-type-select', |
|
|
|
|
clearable: false, |
|
|
|
|
value: type || menuItems[0], |
|
|
|
|
options: menuItems.map((type) => { |
|
|
|
|
}}> |
|
|
|
|
{this.context.t('here')} |
|
|
|
|
</span> |
|
|
|
|
</div> |
|
|
|
|
<div className="new-account-import-form__select-section"> |
|
|
|
|
<div className="new-account-import-form__select-label"> |
|
|
|
|
{this.context.t('selectType')} |
|
|
|
|
</div> |
|
|
|
|
<Select |
|
|
|
|
className="new-account-import-form__select" |
|
|
|
|
name="import-type-select" |
|
|
|
|
clearable={false} |
|
|
|
|
value={type || menuItems[0]} |
|
|
|
|
options={menuItems.map((type) => { |
|
|
|
|
return { |
|
|
|
|
value: type, |
|
|
|
|
label: type, |
|
|
|
|
} |
|
|
|
|
}), |
|
|
|
|
onChange: (opt) => { |
|
|
|
|
})} |
|
|
|
|
onChange={(opt) => { |
|
|
|
|
this.setState({ type: opt.value }) |
|
|
|
|
}, |
|
|
|
|
}), |
|
|
|
|
|
|
|
|
|
]), |
|
|
|
|
|
|
|
|
|
this.renderImportView(), |
|
|
|
|
]) |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{this.renderImportView()} |
|
|
|
|
</div> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -87,10 +83,10 @@ AccountImportSubview.prototype.renderImportView = function () { |
|
|
|
|
|
|
|
|
|
switch (current) { |
|
|
|
|
case this.context.t('privateKey'): |
|
|
|
|
return h(PrivateKeyImportView) |
|
|
|
|
return <PrivateKeyImportView /> |
|
|
|
|
case this.context.t('jsonFile'): |
|
|
|
|
return h(JsonImportView) |
|
|
|
|
return <JsonImportView /> |
|
|
|
|
default: |
|
|
|
|
return h(JsonImportView) |
|
|
|
|
return <JsonImportView /> |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|