From 48867d95fe1a064683f96ad60fd36c893500f62c Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 19 Sep 2017 22:46:51 -0230 Subject: ReadOnlyInput component. --- ui/app/components/readonly-input.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ui/app/components/readonly-input.js (limited to 'ui/app/components/readonly-input.js') diff --git a/ui/app/components/readonly-input.js b/ui/app/components/readonly-input.js new file mode 100644 index 000000000..b688e0722 --- /dev/null +++ b/ui/app/components/readonly-input.js @@ -0,0 +1,27 @@ +const Component = require('react').Component +const h = require('react-hyperscript') +const inherits = require('util').inherits + +module.exports = ReadOnlyInput + +inherits(ReadOnlyInput, Component) +function ReadOnlyInput () { + Component.call(this) +} + +ReadOnlyInput.prototype.render = function () { + const { + wrapperClass, + inputClass, + value, + } = this.props + + return h('div', {className: wrapperClass}, [ + h('input', { + className: inputClass, + value, + readOnly: true, + }), + ]) +} + -- cgit From e325e5e2f5f9d09ade29bc86ec160b6da0eb6b71 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 22 Sep 2017 17:31:32 -0230 Subject: Default class params to empty string in readonly-input --- ui/app/components/readonly-input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui/app/components/readonly-input.js') diff --git a/ui/app/components/readonly-input.js b/ui/app/components/readonly-input.js index b688e0722..934cbefae 100644 --- a/ui/app/components/readonly-input.js +++ b/ui/app/components/readonly-input.js @@ -11,8 +11,8 @@ function ReadOnlyInput () { ReadOnlyInput.prototype.render = function () { const { - wrapperClass, - inputClass, + wrapperClass = '', + inputClass = '', value, } = this.props -- cgit From 7102772c3a4a73d594ccc20e760defa2999f2d3f Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 20 Sep 2017 10:02:18 -0230 Subject: Connect export key modal to state and enable actions. --- ui/app/components/readonly-input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ui/app/components/readonly-input.js') diff --git a/ui/app/components/readonly-input.js b/ui/app/components/readonly-input.js index 934cbefae..33b93b5a0 100644 --- a/ui/app/components/readonly-input.js +++ b/ui/app/components/readonly-input.js @@ -14,13 +14,17 @@ ReadOnlyInput.prototype.render = function () { wrapperClass = '', inputClass = '', value, + textarea, } = this.props + const inputType = textarea ? 'textarea' : 'input' + return h('div', {className: wrapperClass}, [ - h('input', { + h(inputType, { className: inputClass, value, readOnly: true, + onFocus: event => event.target.select(), }), ]) } -- cgit From 222a203353dd977f497d44bf6581c16200b5de4f Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 13 Oct 2017 16:23:10 -0400 Subject: Fix click to copy for private key not working (#2360) --- ui/app/components/readonly-input.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/app/components/readonly-input.js') diff --git a/ui/app/components/readonly-input.js b/ui/app/components/readonly-input.js index 33b93b5a0..fcf05fb9e 100644 --- a/ui/app/components/readonly-input.js +++ b/ui/app/components/readonly-input.js @@ -15,6 +15,7 @@ ReadOnlyInput.prototype.render = function () { inputClass = '', value, textarea, + onClick, } = this.props const inputType = textarea ? 'textarea' : 'input' @@ -25,6 +26,7 @@ ReadOnlyInput.prototype.render = function () { value, readOnly: true, onFocus: event => event.target.select(), + onClick, }), ]) } -- cgit