aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/dropdowns
diff options
context:
space:
mode:
authorChi Kei Chan <chikeichan@gmail.com>2017-09-19 02:28:10 +0800
committerChi Kei Chan <chikeichan@gmail.com>2017-09-19 02:28:10 +0800
commit6c5865d564167c1097d6010e47d1e82a75087fd1 (patch)
tree9ced5adba4b6e5b77724f19a086a10981ba7e375 /ui/app/components/dropdowns
parent54bbf8d8590014b92e7857f30bdc2d8f3779431a (diff)
parent693655e2da7cacf5a5326b50bddc37bcece9422e (diff)
downloadtangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar.gz
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar.bz2
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar.lz
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar.xz
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.tar.zst
tangerine-wallet-browser-6c5865d564167c1097d6010e47d1e82a75087fd1.zip
Merge branch 'master' into nm
Diffstat (limited to 'ui/app/components/dropdowns')
-rw-r--r--ui/app/components/dropdowns/components/account-dropdowns.js37
1 files changed, 35 insertions, 2 deletions
diff --git a/ui/app/components/dropdowns/components/account-dropdowns.js b/ui/app/components/dropdowns/components/account-dropdowns.js
index bb112dcca..fe80af8b3 100644
--- a/ui/app/components/dropdowns/components/account-dropdowns.js
+++ b/ui/app/components/dropdowns/components/account-dropdowns.js
@@ -25,7 +25,7 @@ class AccountDropdowns extends Component {
}
renderAccounts () {
- const { identities, accounts, selected, menuItemStyles, actions } = this.props
+ const { identities, accounts, selected, menuItemStyles, actions, keyrings } = this.props
return Object.keys(identities).map((key, index) => {
const identity = identities[key]
@@ -33,6 +33,12 @@ class AccountDropdowns extends Component {
const balanceValue = accounts[key].balance
const formattedBalance = balanceValue ? formatBalance(balanceValue, 6) : '...'
+ 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,
@@ -88,6 +94,7 @@ class AccountDropdowns extends Component {
marginLeft: '10px',
},
}, [
+ this.indicateIfLoose(keyring),
h('span.account-dropdown-name', {
style: {
fontSize: '18px',
@@ -97,6 +104,7 @@ class AccountDropdowns extends Component {
textOverflow: 'ellipsis',
},
}, identity.name || ''),
+ h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null),
h('span.account-dropdown-balance', {
style: {
@@ -125,11 +133,35 @@ class AccountDropdowns extends Component {
]),
]),
+// =======
+// },
+// ),
+// this.indicateIfLoose(keyring),
+// h('span', {
+// style: {
+// marginLeft: '20px',
+// fontSize: '24px',
+// maxWidth: '145px',
+// whiteSpace: 'nowrap',
+// overflow: 'hidden',
+// textOverflow: 'ellipsis',
+// },
+// }, identity.name || ''),
+// h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null),
+// >>>>>>> master:ui/app/components/account-dropdowns.js
]
)
})
}
+ indicateIfLoose (keyring) {
+ try { // Sometimes keyrings aren't loaded yet:
+ const type = keyring.type
+ const isLoose = type !== 'HD Key Tree'
+ return isLoose ? h('.keyring-label', 'LOOSE') : null
+ } catch (e) { return }
+ }
+
renderAccountSelector () {
const { actions, useCssTransition, innerStyle } = this.props
const { accountSelectorActive, menuItemStyles } = this.state
@@ -389,7 +421,8 @@ AccountDropdowns.defaultProps = {
AccountDropdowns.propTypes = {
identities: PropTypes.objectOf(PropTypes.object),
- selected: PropTypes.string, // TODO: refactor to be more explicit: selectedAddress
+ selected: PropTypes.string,
+ keyrings: PropTypes.array,
}
const mapDispatchToProps = (dispatch) => {