Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created February 7, 2017 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregturn/ed87a4f479c93f4f5e02358499db3835 to your computer and use it in GitHub Desktop.
Save gregturn/ed87a4f479c93f4f5e02358499db3835 to your computer and use it in GitHub Desktop.
'use strict';
const React = require('react')
class TextInput extends React.Component {
constructor(props) {
super(props)
}
render() {
let labelLayout = (this.props.labelLayout) ? this.props.labelLayout : 'layout__item u-1/2-lap-and-up u-1/4-desk'
let inputLayout = (this.props.inputLayout) ? this.props.inputLayout : 'layout__item u-1/2-lap-and-up u-3/4-desk'
let optional = (this.props.optional) ? this.props.optional : null
return (<li className='control-group'>
<label className={labelLayout}>{this.props.label}</label>
{optional}
<input className={inputLayout} type="text"
placeholder={this.props.placeHolder}
name={this.props.name}
onChange={this.props.handleChange}
value={this.props.settings[this.props.name]} />
</li>)
}
}
module.exports = TextInput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment