From c65db9290dd02b762c0260fe98945f63162f285d Mon Sep 17 00:00:00 2001 From: Luis Iván Cuende Date: Wed, 14 Dec 2016 09:38:20 -0800 Subject: Better editable label --- ui/app/components/editable-label.js | 37 ++++++------------------------------- ui/app/components/identicon.js | 2 +- 2 files changed, 7 insertions(+), 32 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 41936f5e0..bc0f9a5b2 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -11,40 +11,15 @@ function EditableLabel () { } EditableLabel.prototype.render = function () { - const props = this.props - const state = this.state - - if (state && state.isEditingLabel) { - return h('div.editable-label', [ - h('input.sizing-input', { - defaultValue: props.textValue, - maxLength: '20', - onKeyPress: (event) => { - this.saveIfEnter(event) - }, - }), - h('button.editable-button', { - onClick: () => this.saveText(), - }, 'Save'), - ]) - } else { - return h('div.name-label', { - onClick: (event) => { - this.setState({ isEditingLabel: true }) - }, - }, this.props.children) - } -} - -EditableLabel.prototype.saveIfEnter = function (event) { - if (event.key === 'Enter') { - this.saveText() - } + return h('div.name-label', { + contentEditable: true, + style: { outline: 'none' }, + onInput: (event) => this.saveText(), + }, this.props.children) } EditableLabel.prototype.saveText = function () { - var container = findDOMNode(this) - var text = container.querySelector('.editable-label input').value + var text = findDOMNode(this).textContent.trim() var truncatedText = text.substring(0, 20) this.props.saveText(truncatedText) this.setState({ isEditingLabel: false, textLabel: truncatedText }) diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index 6d4871d02..8211867cb 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -12,7 +12,7 @@ inherits(IdenticonComponent, Component) function IdenticonComponent () { Component.call(this) - this.defaultDiameter = 46 + this.defaultDiameter = 32 } IdenticonComponent.prototype.render = function () { -- cgit From 4a8bc63c8d8cd4191bbfc0e13077f2356ea7cfbc Mon Sep 17 00:00:00 2001 From: Luis Iván Cuende Date: Wed, 14 Dec 2016 10:03:56 -0800 Subject: Better account details view --- ui/app/components/editable-label.js | 5 ++++- ui/app/components/tooltip.js | 2 +- ui/app/components/transaction-list.js | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index bc0f9a5b2..14c0294a2 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -13,7 +13,10 @@ function EditableLabel () { EditableLabel.prototype.render = function () { return h('div.name-label', { contentEditable: true, - style: { outline: 'none' }, + style: { + outline: 'none', + marginTop: '0.5rem', + }, onInput: (event) => this.saveText(), }, this.props.children) } diff --git a/ui/app/components/tooltip.js b/ui/app/components/tooltip.js index edbc074bb..efab2c497 100644 --- a/ui/app/components/tooltip.js +++ b/ui/app/components/tooltip.js @@ -17,6 +17,6 @@ Tooltip.prototype.render = function () { return h(ReactTooltip, { position: position || 'left', title, - fixed: false, + fixed: true, }, children) } diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index 7e1bedb05..f6a4ed07e 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -79,10 +79,9 @@ TransactionList.prototype.render = function () { height: '100%', }, }, [ - 'No transaction history.', + 'No transaction history', ]), ]), ]) ) } - -- cgit From 83880a5c92df6024e3420ecf19d55585f5d2b185 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 15 Dec 2016 16:09:39 -0800 Subject: Remove morden testnet provider Instances configured to point at Morden will now point at Ropsten. --- ui/app/components/drop-menu-item.js | 3 --- ui/app/components/network.js | 12 ------------ 2 files changed, 15 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js index b82114f03..ac0aecadd 100644 --- a/ui/app/components/drop-menu-item.js +++ b/ui/app/components/drop-menu-item.js @@ -44,9 +44,6 @@ DropMenuItem.prototype.activeNetworkRender = function () { case 'Ropsten Test Network': if (provider.type === 'testnet') return h('.check', '✓') break - case 'Morden Test Network': - if (provider.type === 'morden') return h('.check', '✓') - break case 'Localhost 8545': if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') break diff --git a/ui/app/components/network.js b/ui/app/components/network.js index b7d3cdbf5..1f61ef73f 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -42,9 +42,6 @@ Network.prototype.render = function () { } else if (parseInt(networkNumber) === 3) { hoverText = 'Ropsten Test Network' iconName = 'ropsten-test-network' - } else if (parseInt(networkNumber) === 2) { - hoverText = 'Morden Test Network' - iconName = 'morden-test-network' } else { hoverText = 'Unknown Private Network' iconName = 'unknown-private-network' @@ -79,15 +76,6 @@ Network.prototype.render = function () { }}, 'Ropsten Test Net'), ]) - case 'morden-test-network': - return h('.network-indicator', [ - h('.menu-icon.red-dot'), - h('.network-name', { - style: { - color: '#ff6666', - }}, - 'Morden Test Net'), - ]) default: return h('.network-indicator', [ h('i.fa.fa-question-circle.fa-lg', { -- cgit From 6d13ef691f4162caad6b8742a21d0b75f8baccca Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 16 Dec 2016 10:04:57 -0800 Subject: Revert "Interface enhancements" --- ui/app/components/editable-label.js | 40 +++++++++++++++++++++++++++-------- ui/app/components/identicon.js | 2 +- ui/app/components/tooltip.js | 2 +- ui/app/components/transaction-list.js | 3 ++- 4 files changed, 35 insertions(+), 12 deletions(-) (limited to 'ui/app/components') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 14c0294a2..41936f5e0 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -11,18 +11,40 @@ function EditableLabel () { } EditableLabel.prototype.render = function () { - return h('div.name-label', { - contentEditable: true, - style: { - outline: 'none', - marginTop: '0.5rem', - }, - onInput: (event) => this.saveText(), - }, this.props.children) + const props = this.props + const state = this.state + + if (state && state.isEditingLabel) { + return h('div.editable-label', [ + h('input.sizing-input', { + defaultValue: props.textValue, + maxLength: '20', + onKeyPress: (event) => { + this.saveIfEnter(event) + }, + }), + h('button.editable-button', { + onClick: () => this.saveText(), + }, 'Save'), + ]) + } else { + return h('div.name-label', { + onClick: (event) => { + this.setState({ isEditingLabel: true }) + }, + }, this.props.children) + } +} + +EditableLabel.prototype.saveIfEnter = function (event) { + if (event.key === 'Enter') { + this.saveText() + } } EditableLabel.prototype.saveText = function () { - var text = findDOMNode(this).textContent.trim() + var container = findDOMNode(this) + var text = container.querySelector('.editable-label input').value var truncatedText = text.substring(0, 20) this.props.saveText(truncatedText) this.setState({ isEditingLabel: false, textLabel: truncatedText }) diff --git a/ui/app/components/identicon.js b/ui/app/components/identicon.js index 8211867cb..6d4871d02 100644 --- a/ui/app/components/identicon.js +++ b/ui/app/components/identicon.js @@ -12,7 +12,7 @@ inherits(IdenticonComponent, Component) function IdenticonComponent () { Component.call(this) - this.defaultDiameter = 32 + this.defaultDiameter = 46 } IdenticonComponent.prototype.render = function () { diff --git a/ui/app/components/tooltip.js b/ui/app/components/tooltip.js index efab2c497..edbc074bb 100644 --- a/ui/app/components/tooltip.js +++ b/ui/app/components/tooltip.js @@ -17,6 +17,6 @@ Tooltip.prototype.render = function () { return h(ReactTooltip, { position: position || 'left', title, - fixed: true, + fixed: false, }, children) } diff --git a/ui/app/components/transaction-list.js b/ui/app/components/transaction-list.js index f6a4ed07e..7e1bedb05 100644 --- a/ui/app/components/transaction-list.js +++ b/ui/app/components/transaction-list.js @@ -79,9 +79,10 @@ TransactionList.prototype.render = function () { height: '100%', }, }, [ - 'No transaction history', + 'No transaction history.', ]), ]), ]) ) } + -- cgit