From a3d0b71320d50db0309e6b39d39416441233faf7 Mon Sep 17 00:00:00 2001 From: Whymarrh Whitby Date: Sat, 23 Nov 2019 00:44:44 -0330 Subject: [PATCH] Convert ReadOnlyInput component to use JSX (#7512) --- ui/app/components/ui/readonly-input.js | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/app/components/ui/readonly-input.js b/ui/app/components/ui/readonly-input.js index fcf05fb9e..212770465 100644 --- a/ui/app/components/ui/readonly-input.js +++ b/ui/app/components/ui/readonly-input.js @@ -1,5 +1,4 @@ -const Component = require('react').Component -const h = require('react-hyperscript') +import React, { Component } from 'react' const inherits = require('util').inherits module.exports = ReadOnlyInput @@ -9,7 +8,7 @@ function ReadOnlyInput () { Component.call(this) } -ReadOnlyInput.prototype.render = function () { +ReadOnlyInput.prototype.render = function ReadOnlyInput () { const { wrapperClass = '', inputClass = '', @@ -18,16 +17,18 @@ ReadOnlyInput.prototype.render = function () { onClick, } = this.props - const inputType = textarea ? 'textarea' : 'input' + const InputType = textarea ? 'textarea' : 'input' - return h('div', {className: wrapperClass}, [ - h(inputType, { - className: inputClass, - value, - readOnly: true, - onFocus: event => event.target.select(), - onClick, - }), - ]) + return ( +
+ event.target.select()} + onClick={onClick} + /> +
+ ) }