diff options
author | brunobar79 <brunobar79@gmail.com> | 2018-07-10 12:20:00 +0800 |
---|---|---|
committer | brunobar79 <brunobar79@gmail.com> | 2018-07-10 12:20:00 +0800 |
commit | 9b81180ab10cf8ca59666104e862c0331e953591 (patch) | |
tree | 4f5c6082395ec9f0f477dbb4ef2bb958913b1d7e /ui | |
parent | 85a4e39b052b8e0c9d277766c79d1a2b5459d934 (diff) | |
download | tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar.gz tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar.bz2 tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar.lz tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar.xz tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.tar.zst tangerine-wallet-browser-9b81180ab10cf8ca59666104e862c0331e953591.zip |
added ui to remove accounts
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/account-menu/index.js | 34 | ||||
-rw-r--r-- | ui/app/css/itcss/components/account-menu.scss | 17 |
2 files changed, 47 insertions, 4 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index be6963ac4..9530d6aeb 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -187,16 +187,42 @@ AccountMenu.prototype.renderAccounts = function () { h('div.account-menu__balance', formattedBalance), ]), - this.indicateIfLoose(keyring), + this.renderKeyringType(keyring), + this.renderForgetAccount(keyring, identity.address), ], ) }) } -AccountMenu.prototype.indicateIfLoose = function (keyring) { +AccountMenu.prototype.renderForgetAccount = function (keyring, address) { + // Any account that's not form the HD wallet can be forgotten + const type = keyring.type + const isForgetable = type !== 'HD Key Tree' + return isForgetable ? h('a.forget-account-icon', { onClick: (e) => this.forgetAccount(e, address) }, '') : null +} + +AccountMenu.prototype.forgetAccount = function (e, address) { + e.preventDefault() + e.stopPropagation() + console.log('should forget address: ', address) +} + +AccountMenu.prototype.renderKeyringType = function (keyring) { try { // Sometimes keyrings aren't loaded yet: const type = keyring.type - const isLoose = type !== 'HD Key Tree' - return isLoose ? h('.keyring-label.allcaps', this.context.t('imported')) : null + let label + switch (type) { + case 'Trezor Hardware': + label = this.context.t('hardware') + break + case 'Simple Key Pair': + label = this.context.t('imported') + break + default: + label = '' + } + + return label !== '' ? h('.keyring-label.allcaps', label) : null + } catch (e) { return } } diff --git a/ui/app/css/itcss/components/account-menu.scss b/ui/app/css/itcss/components/account-menu.scss index 96fba890c..20fc68424 100644 --- a/ui/app/css/itcss/components/account-menu.scss +++ b/ui/app/css/itcss/components/account-menu.scss @@ -72,6 +72,7 @@ background-color: $dusty-gray; color: $black; font-weight: normal; + letter-spacing: .5px; } } @@ -84,6 +85,22 @@ @media screen and (max-width: 575px) { padding: 12px 14px; } + + .forget-account-icon { + width: 25px; + margin-left: 10px; + } + + &:hover { + .forget-account-icon::after { + content: '\00D7'; + font-size: 25px; + color: $white; + cursor: pointer; + position: absolute; + margin-top: -5px; + } + } } &__account-info { |