The code powering m.abunchtell.com https://m.abunchtell.com
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

42 lines
870 B

  1. import ImmutablePropTypes from 'react-immutable-proptypes';
  2. const style = {
  3. display: 'block',
  4. fontFamily: 'inherit',
  5. marginBottom: '10px',
  6. padding: '7px 0',
  7. boxSizing: 'border-box',
  8. width: '100%'
  9. };
  10. const SettingText = React.createClass({
  11. propTypes: {
  12. settings: ImmutablePropTypes.map.isRequired,
  13. settingKey: React.PropTypes.array.isRequired,
  14. label: React.PropTypes.string.isRequired,
  15. onChange: React.PropTypes.func.isRequired
  16. },
  17. handleChange (e) {
  18. this.props.onChange(this.props.settingKey, e.target.value)
  19. },
  20. render () {
  21. const { settings, settingKey, label } = this.props;
  22. return (
  23. <input
  24. style={style}
  25. className='setting-text'
  26. value={settings.getIn(settingKey)}
  27. onChange={this.handleChange}
  28. placeholder={label}
  29. />
  30. );
  31. }
  32. });
  33. export default SettingText;