aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/editable-label.js40
-rw-r--r--ui/app/components/identicon.js2
-rw-r--r--ui/app/components/tooltip.js2
-rw-r--r--ui/app/components/transaction-list.js3
4 files changed, 35 insertions, 12 deletions
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.',
]),
]),
])
)
}
+