diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-08-14 07:29:43 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-08-14 07:29:43 +0800 |
commit | 4e1d8ba19db729f5c282c4e3c6b43433b562a45e (patch) | |
tree | 6d8470f9289247a9f4998e44de075674486c6125 /ui/app/components/pages/create-account/connect-hardware/account-list.js | |
parent | 77ad856730d5b54974b86e9bed7952ff1dc10fe0 (diff) | |
download | tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.gz tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.tar.zst tangerine-wallet-browser-4e1d8ba19db729f5c282c4e3c6b43433b562a45e.zip |
good progress adding paths
Diffstat (limited to 'ui/app/components/pages/create-account/connect-hardware/account-list.js')
-rw-r--r-- | ui/app/components/pages/create-account/connect-hardware/account-list.js | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/ui/app/components/pages/create-account/connect-hardware/account-list.js b/ui/app/components/pages/create-account/connect-hardware/account-list.js index ac020345a..4c6cc67f9 100644 --- a/ui/app/components/pages/create-account/connect-hardware/account-list.js +++ b/ui/app/components/pages/create-account/connect-hardware/account-list.js @@ -2,16 +2,53 @@ const { Component } = require('react') const PropTypes = require('prop-types') const h = require('react-hyperscript') const genAccountLink = require('../../../../../lib/account-link.js') +const Select = require('react-select').default class AccountList extends Component { constructor (props, context) { super(props) } + getHdPaths () { + return [ + { + label: `m/44'/60'/0' (Legacy)`, + value: `m/44'/60'/0'`, + }, + { + label: `m/44'/60'/0'/0`, + value: `m/44'/60'/0'/0'`, + }, + ] + } + + renderHdPathSelector () { + const { onPathChange, selectedPath } = this.props + + const options = this.getHdPaths() + return h('div.hw-connect__hdPath', [ + h('h3.hw-connect__hdPath__title', {}, `HD Path`), + h(Select, { + className: 'hw-connect__hdPath__select', + name: 'hd-path-select', + clearable: false, + value: selectedPath, + options, + onChange: (opt) => { + onPathChange(opt.value) + }, + }), + ]) + } renderHeader () { + const { device } = this.props return ( h('div.hw-connect', [ - h('h3.hw-connect__title', {}, `${this.props.device.toUpperCase()} - ${this.context.t('selectAnAccount')}`), + + h('h3.hw-connect__title', {}, `${device.toUpperCase()} - ${this.context.t('selectAnAccount')}`), + + device.toLowerCase() === 'ledger' ? this.renderHdPathSelector() : null, + h('p.hw-connect__msg', {}, this.context.t('selectAnAccountHelp')), ]) ) @@ -125,6 +162,8 @@ class AccountList extends Component { AccountList.propTypes = { + onPathChange: PropTypes.func.isRequired, + selectedPath: PropTypes.string.isRequired, device: PropTypes.string.isRequired, accounts: PropTypes.array.isRequired, onAccountChange: PropTypes.func.isRequired, |