diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-25 11:04:29 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-25 11:04:29 +0800 |
commit | 630ab79cc313fa280e6a3d6a2655dafacb6b9659 (patch) | |
tree | cc3460d691e15bb5ccbe0e800fdc69747507ec84 /ui/app/components | |
parent | ad91fcd6628bb892b4c37da50b9e93e7d4605d5a (diff) | |
download | tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar.gz tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar.bz2 tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar.lz tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar.xz tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.tar.zst tangerine-wallet-browser-630ab79cc313fa280e6a3d6a2655dafacb6b9659.zip |
Styling and UX changes on sidebar
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/wallet-view.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ui/app/components/wallet-view.js b/ui/app/components/wallet-view.js index 9c11ca4a5..3cb7a8b76 100644 --- a/ui/app/components/wallet-view.js +++ b/ui/app/components/wallet-view.js @@ -43,6 +43,9 @@ function mapDispatchToProps (dispatch) { inherits(WalletView, Component) function WalletView () { Component.call(this) + this.state = { + hasCopied: false, + } } WalletView.prototype.renderWalletBalance = function () { @@ -132,19 +135,18 @@ WalletView.prototype.render = function () { ]), - h('div.wallet-view__address', { onClick: () => copyToClipboard(selectedAddress) }, [ - `${selectedAddress.slice(0, 4)}...${selectedAddress.slice(-4)}`, + h('div.wallet-view__address', { + onClick: () => { + copyToClipboard(selectedAddress) + this.setState({ hasCopied: true }) + setTimeout(() => this.setState({ hasCopied: false }), 3000) + }, + }, [ + this.state.hasCopied && 'Copied to Clipboard', + !this.state.hasCopied && `${selectedAddress.slice(0, 4)}...${selectedAddress.slice(-4)}`, h('i.fa.fa-clipboard', { style: { marginLeft: '8px' } }), ]), - // 'Wallet' - Title - // Not visible on mobile - h('div.flex-column.wallet-view-title-wrapper', [ - h('span.wallet-view-title', [ - 'Wallet', - ]), - ]), - this.renderWalletBalance(), h(TokenList), |