@rnga/orders
Version:
## Get schema from @prisma-cms 1. yarn get-api-schema -e http://localhost:4000 2. yarn build-api-fragments
54 lines (44 loc) • 798 B
JavaScript
import React, { Component, Fragment } from 'react'
import PropTypes from 'prop-types'
export default class Input extends Component {
static propTypes = {
// prop: PropTypes
}
static defaultProps = {
};
renderInput(props) {
return <input
{...props}
/>
}
render() {
const {
error,
helperText,
style,
...other
} = this.props;
return <Fragment>
{this.renderInput({
...other,
style: {
width: "100%",
...style,
},
})}
{helperText
?
<div
style={{
color: error ? "red" : undefined,
fontSize: "0.8rem",
}}
>
{helperText}
</div>
:
null
}
</Fragment>;
}
}