mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Convert ReadOnlyInput to functional component (#7788)
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
This commit is contained in:
parent
e20163bfda
commit
3b3325d191
@ -1,21 +1,14 @@
|
||||
import React, { Component } from 'react'
|
||||
import { inherits } from 'util'
|
||||
import PropTypes from 'prop-types'
|
||||
import React from 'react'
|
||||
|
||||
export default ReadOnlyInput
|
||||
|
||||
inherits(ReadOnlyInput, Component)
|
||||
function ReadOnlyInput () {
|
||||
Component.call(this)
|
||||
}
|
||||
|
||||
ReadOnlyInput.prototype.render = function ReadOnlyInput () {
|
||||
export default function ReadOnlyInput (props) {
|
||||
const {
|
||||
wrapperClass = '',
|
||||
inputClass = '',
|
||||
value,
|
||||
textarea,
|
||||
onClick,
|
||||
} = this.props
|
||||
} = props
|
||||
|
||||
const InputType = textarea ? 'textarea' : 'input'
|
||||
|
||||
@ -32,3 +25,10 @@ ReadOnlyInput.prototype.render = function ReadOnlyInput () {
|
||||
)
|
||||
}
|
||||
|
||||
ReadOnlyInput.propTypes = {
|
||||
wrapperClass: PropTypes.string,
|
||||
inputClass: PropTypes.string,
|
||||
value: PropTypes.string,
|
||||
textarea: PropTypes.bool,
|
||||
onClick: PropTypes.func,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user