2016-05-13 01:47:22 +08:00
|
|
|
import React, {Component, PropTypes} from 'react'
|
|
|
|
|
|
|
|
export default class SubjectTextField extends Component {
|
|
|
|
static displayName = 'SubjectTextField'
|
|
|
|
|
|
|
|
static containerRequired = false
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
value: PropTypes.string,
|
|
|
|
onSubjectChange: PropTypes.func,
|
|
|
|
}
|
|
|
|
|
|
|
|
onInputChange = ({target: {value}}) => {
|
|
|
|
this.props.onSubjectChange(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
focus() {
|
2017-07-24 07:19:39 +08:00
|
|
|
this._el.focus()
|
2016-05-13 01:47:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {value} = this.props
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="composer-subject subject-field">
|
|
|
|
<input
|
2017-07-24 07:19:39 +08:00
|
|
|
ref={el => { this._el = el; }}
|
2016-05-13 01:47:22 +08:00
|
|
|
type="text"
|
|
|
|
name="subject"
|
|
|
|
placeholder="Subject"
|
|
|
|
value={value}
|
|
|
|
onChange={this.onInputChange}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|