1948f9e767
* Remove deprecated features at React v15.5
- [x] React.PropTypes
- [x] react-addons-pure-render-mixin
- [x] react-addons-test-utils
* Uncommented out & Add browserify_rails options
* re-add react-addons-shallow
* Fix syntax error from resolve conflicts
* follow up 59a77923b3
48 lines
1,013 B
JavaScript
48 lines
1,013 B
JavaScript
import PropTypes from 'prop-types';
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
const style = {
|
|
display: 'block',
|
|
fontFamily: 'inherit',
|
|
marginBottom: '10px',
|
|
padding: '7px 0',
|
|
boxSizing: 'border-box',
|
|
width: '100%'
|
|
};
|
|
|
|
class SettingText extends React.PureComponent {
|
|
|
|
constructor (props, context) {
|
|
super(props, context);
|
|
this.handleChange = this.handleChange.bind(this);
|
|
}
|
|
|
|
handleChange (e) {
|
|
this.props.onChange(this.props.settingKey, e.target.value)
|
|
}
|
|
|
|
render () {
|
|
const { settings, settingKey, label } = this.props;
|
|
|
|
return (
|
|
<input
|
|
style={style}
|
|
className='setting-text'
|
|
value={settings.getIn(settingKey)}
|
|
onChange={this.handleChange}
|
|
placeholder={label}
|
|
/>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
SettingText.propTypes = {
|
|
settings: ImmutablePropTypes.map.isRequired,
|
|
settingKey: PropTypes.array.isRequired,
|
|
label: PropTypes.string.isRequired,
|
|
onChange: PropTypes.func.isRequired
|
|
};
|
|
|
|
export default SettingText;
|