From 88f4931c6f875be5186a0071e2cec5b78fb34b57 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:37:36 -0700 Subject: [PATCH 1/4] Fix text overflow for dropdown components flagged by @frankiebee --- ui/app/components/account-dropdowns.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js index b23600e9b..bd60db51e 100644 --- a/ui/app/components/account-dropdowns.js +++ b/ui/app/components/account-dropdowns.js @@ -27,6 +27,10 @@ class AccountDropdowns extends Component { return Object.keys(identities).map((key, index) => { const identity = identities[key] const isSelected = identity.address === selected + console.log("address", identity.address) + console.log("selected:", selected) + console.log("isSelected:", isSelected) + // debugger; return h( DropdownMenuItem, @@ -51,7 +55,16 @@ class AccountDropdowns extends Component { }, }, ), - h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, identity.name || ''), + 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), ] ) From 771f9ec124c758556ebba11067e66c9d4843455d Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:37:55 -0700 Subject: [PATCH 2/4] Fix logic for dropdown components attaching checkmark to correct account --- ui/app/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/app/app.js b/ui/app/app.js index 4565bdd37..60d36772a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -43,6 +43,7 @@ function mapStateToProps (state) { accounts, address, } = state.metamask + console.log("ADDRESS:", address) const selected = address || Object.keys(accounts)[0] return { @@ -185,7 +186,7 @@ App.prototype.renderAppBar = function () { style: {}, enableAccountsSelector: true, identities: this.props.identities, - selected: this.props.selected, + selected: this.props.currentView.context, network: this.props.network, }, []), From 2346c9b6b9322458b350d5afd19501372272f0ec Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:49:12 -0700 Subject: [PATCH 3/4] Add overflow support for all account names in account details --- ui/app/account-detail.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 22a883096..f6041e856 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -107,14 +107,23 @@ AccountDetailScreen.prototype.render = function () { }, [ h( - 'h2.font-medium.color-forest', + 'div.font-medium.color-forest', { name: 'edit', style: { }, }, [ - identity && identity.name, + h('h2', { + style: { + maxWidth: '180px', + overflowX: 'hidden', + textOverflow: 'ellipsis', + padding: '5px 0px', + }, + }, [ + identity && identity.name, + ]), ] ), h( From 9ec86636050c6d642ff5fa9bf3413d17ccba1a24 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:49:59 -0700 Subject: [PATCH 4/4] Cleanup stray logs and lint --- ui/app/app.js | 1 - ui/app/components/account-dropdowns.js | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/app/app.js b/ui/app/app.js index 60d36772a..1f3d5b0f8 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -43,7 +43,6 @@ function mapStateToProps (state) { accounts, address, } = state.metamask - console.log("ADDRESS:", address) const selected = address || Object.keys(accounts)[0] return { diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js index bd60db51e..7c24e70bd 100644 --- a/ui/app/components/account-dropdowns.js +++ b/ui/app/components/account-dropdowns.js @@ -27,10 +27,6 @@ class AccountDropdowns extends Component { return Object.keys(identities).map((key, index) => { const identity = identities[key] const isSelected = identity.address === selected - console.log("address", identity.address) - console.log("selected:", selected) - console.log("isSelected:", isSelected) - // debugger; return h( DropdownMenuItem, @@ -63,7 +59,7 @@ class AccountDropdowns extends Component { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', - } + }, }, identity.name || ''), h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null), ]