aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
authorKevin Serrano <kevin.serrano@consensys.net>2017-08-10 08:40:01 +0800
committerKevin Serrano <kevin.serrano@consensys.net>2017-08-10 08:40:01 +0800
commit45fc1d6ec356232e51fe4a9cc1f01929e35e8014 (patch)
treee62ed47fb114c5dac04af9aa1cbb6b6cbeeff495 /ui/app/components
parent1071a35f7be1f231542e5b784cafd47720839d14 (diff)
downloadtangerine-wallet-browser-45fc1d6ec356232e51fe4a9cc1f01929e35e8014.tar.gz
tangerine-wallet-browser-45fc1d6ec356232e51fe4a9cc1f01929e35e8014.tar.zst
tangerine-wallet-browser-45fc1d6ec356232e51fe4a9cc1f01929e35e8014.zip
Readd loose label onto accounts.
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/account-dropdowns.js20
-rw-r--r--ui/app/components/dropdown.js2
2 files changed, 20 insertions, 2 deletions
diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js
index b23600e9b..9a68b8f20 100644
--- a/ui/app/components/account-dropdowns.js
+++ b/ui/app/components/account-dropdowns.js
@@ -22,12 +22,19 @@ class AccountDropdowns extends Component {
}
renderAccounts () {
- const { identities, selected } = this.props
+ const { identities, selected, keyrings } = this.props
return Object.keys(identities).map((key, index) => {
const identity = identities[key]
const isSelected = identity.address === selected
+ const simpleAddress = identity.address.substring(2).toLowerCase()
+
+ const keyring = keyrings.find((kr) => {
+ return kr.accounts.includes(simpleAddress) ||
+ kr.accounts.includes(identity.address)
+ })
+
return h(
DropdownMenuItem,
{
@@ -51,6 +58,7 @@ class AccountDropdowns extends Component {
},
},
),
+ this.indicateIfLoose(keyring.type),
h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, identity.name || ''),
h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null),
]
@@ -58,6 +66,13 @@ class AccountDropdowns extends Component {
})
}
+ indicateIfLoose (type) {
+ try { // Sometimes keyrings aren't loaded yet:
+ const isLoose = type !== 'HD Key Tree'
+ return isLoose ? h('.keyring-label', 'LOOSE') : null
+ } catch (e) { return }
+ }
+
renderAccountSelector () {
const { actions } = this.props
const { accountSelectorActive } = this.state
@@ -136,6 +151,8 @@ class AccountDropdowns extends Component {
)
}
+
+
renderAccountOptions () {
const { actions } = this.props
const { optionsMenuActive } = this.state
@@ -269,6 +286,7 @@ AccountDropdowns.defaultProps = {
AccountDropdowns.propTypes = {
identities: PropTypes.objectOf(PropTypes.object),
selected: PropTypes.string,
+ keyrings: PropTypes.objectOf(PropTypes.object),
}
const mapDispatchToProps = (dispatch) => {
diff --git a/ui/app/components/dropdown.js b/ui/app/components/dropdown.js
index 34c7149ee..73710acc2 100644
--- a/ui/app/components/dropdown.js
+++ b/ui/app/components/dropdown.js
@@ -32,7 +32,7 @@ class Dropdown extends Component {
'style',
`
li.dropdown-menu-item:hover { color:rgb(225, 225, 225); }
- li.dropdown-menu-item { color: rgb(185, 185, 185); }
+ li.dropdown-menu-item { color: rgb(185, 185, 185); position: relative }
`
),
...children,