spee.ch/client/containers/PublishTitleInput/view.jsx

21 lines
598 B
React
Raw Normal View History

2018-01-04 23:14:03 +01:00
import React from 'react';
2018-01-17 19:49:57 +01:00
class PublishTitleInput extends React.Component {
2018-01-04 23:14:03 +01:00
constructor (props) {
super(props);
this.handleInput = this.handleInput.bind(this);
}
handleInput (e) {
const name = e.target.name;
const value = e.target.value;
this.props.onMetadataChange(name, value);
2018-01-04 23:14:03 +01:00
}
render () {
return (
<input type='text' id='publish-title' className='input-text text--large input-text--full-width' name='title' placeholder='Give your post a title...' onChange={this.handleInput} value={this.props.title} />
2018-01-04 23:14:03 +01:00
);
}
}
2018-01-17 19:49:57 +01:00
export default PublishTitleInput;