You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
845 B
35 lines
845 B
8 years ago
|
import React from 'react';
|
||
8 years ago
|
import PropTypes from 'prop-types';
|
||
8 years ago
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||
|
|
||
7 years ago
|
export default class SettingText extends React.PureComponent {
|
||
8 years ago
|
|
||
8 years ago
|
static propTypes = {
|
||
|
settings: ImmutablePropTypes.map.isRequired,
|
||
|
settingKey: PropTypes.array.isRequired,
|
||
|
label: PropTypes.string.isRequired,
|
||
8 years ago
|
onChange: PropTypes.func.isRequired,
|
||
8 years ago
|
};
|
||
|
|
||
|
handleChange = (e) => {
|
||
8 years ago
|
this.props.onChange(this.props.settingKey, e.target.value);
|
||
8 years ago
|
}
|
||
8 years ago
|
|
||
|
render () {
|
||
|
const { settings, settingKey, label } = this.props;
|
||
|
|
||
|
return (
|
||
7 years ago
|
<label>
|
||
|
<span style={{ display: 'none' }}>{label}</span>
|
||
|
<input
|
||
|
className='setting-text'
|
||
|
value={settings.getIn(settingKey)}
|
||
|
onChange={this.handleChange}
|
||
|
placeholder={label}
|
||
|
/>
|
||
|
</label>
|
||
8 years ago
|
);
|
||
|
}
|
||
|
|
||
8 years ago
|
}
|