aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/import/index.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-11-05 06:08:50 +0800
committerDan Finlay <dan@danfinlay.com>2016-11-05 06:32:02 +0800
commitb3cb675a8bd406bd16aa74ff209032075f9b31d7 (patch)
tree0bac415470ef030e259fe30de6975cbe6f8144cf /ui/app/accounts/import/index.js
parenta7af47db928590af8100f16e9e9d36ae98623357 (diff)
downloadtangerine-wallet-browser-b3cb675a8bd406bd16aa74ff209032075f9b31d7.tar.gz
tangerine-wallet-browser-b3cb675a8bd406bd16aa74ff209032075f9b31d7.tar.zst
tangerine-wallet-browser-b3cb675a8bd406bd16aa74ff209032075f9b31d7.zip
Develop import subviews
Diffstat (limited to 'ui/app/accounts/import/index.js')
-rw-r--r--ui/app/accounts/import/index.js42
1 files changed, 27 insertions, 15 deletions
diff --git a/ui/app/accounts/import/index.js b/ui/app/accounts/import/index.js
index a16b1c39d..a7c3252cd 100644
--- a/ui/app/accounts/import/index.js
+++ b/ui/app/accounts/import/index.js
@@ -4,6 +4,10 @@ const h = require('react-hyperscript')
const connect = require('react-redux').connect
import Select from 'react-select'
+// Subviews
+const JsonImportView = require('./json.js')
+const SeedImportView = require('./seed.js')
+
module.exports = connect(mapStateToProps)(AccountImportSubview)
function mapStateToProps (state) {
@@ -31,24 +35,18 @@ AccountImportSubview.prototype.render = function () {
h('div', {
style: {
padding: '10px',
- background: 'rgb(242,242,242)',
color: 'rgb(174, 174, 174)',
},
}, [
- h('h3', 'SELECT TYPE'),
- ]),
- h('style', `
- .has-value.Select--single > .Select-control .Select-value .Select-value-label, .Select-value-label {
- color: rgb(174,174,174);
- }
- `),
+ h('h3', { style: { padding: '3px' } }, 'SELECT TYPE'),
+
+ h('style', `
+ .has-value.Select--single > .Select-control .Select-value .Select-value-label, .Select-value-label {
+ color: rgb(174,174,174);
+ }
+ `),
- h('div', {
- style: {
- padding: '10px',
- },
- }, [
h(Select, {
name: 'import-type-select',
clearable: false,
@@ -62,9 +60,23 @@ AccountImportSubview.prototype.render = function () {
onChange: (opt) => {
this.setState({ type: opt.value })
},
- })
- ])
+ }),
+ ]),
+
+ this.renderImportView(),
])
)
}
+AccountImportSubview.prototype.renderImportView = function() {
+ const props = this.props
+ const state = this.state || {}
+ const { type } = state || props.types[0]
+
+ switch (type) {
+ case 'HD Key Tree':
+ return h(SeedImportView)
+ default:
+ return h(JsonImportView)
+ }
+}