1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 03:36:18 +02:00

Styling and UX changes on sidebar

This commit is contained in:
Chi Kei Chan 2017-10-24 20:04:29 -07:00
parent ad91fcd662
commit 630ab79cc3
2 changed files with 14 additions and 11 deletions

View File

@ -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),

View File

@ -1,4 +1,4 @@
$wallet-balance-bg: $gallery;
$wallet-balance-bg: #e7e7e7;
$wallet-balance-breakpoint: 890px;
$wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and (max-width: #{$wallet-balance-breakpoint})";
@ -20,6 +20,7 @@ $wallet-balance-breakpoint-range: "screen and (min-width: #{$break-large}) and (
align-items: center;
flex: 0 0 auto;
cursor: pointer;
border-top: 1px solid $wallet-balance-bg;
.balance-container {
display: flex;