2015-05-29 01:54:56 +02:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import AlertMixin from '../../mixins/alert_mixin'
|
|
|
|
|
|
|
|
let InputTextArea = React.createClass({
|
|
|
|
|
|
|
|
mixins : [AlertMixin],
|
|
|
|
|
|
|
|
getInitialState() {
|
|
|
|
return {value: this.props.defaultValue,
|
2015-05-29 15:16:42 +02:00
|
|
|
alerts: null // needed in AlertMixin
|
2015-05-29 01:54:56 +02:00
|
|
|
};
|
|
|
|
},
|
|
|
|
handleChange(event) {
|
|
|
|
this.setState({value: event.target.value});
|
|
|
|
},
|
|
|
|
render() {
|
|
|
|
let className = "form-control input-text-ascribe textarea-ascribe-message";
|
|
|
|
|
|
|
|
let alerts = (this.props.submitted) ? null : this.state.alerts;
|
|
|
|
return (
|
|
|
|
<div className="form-group">
|
|
|
|
{alerts}
|
|
|
|
<textarea className={className}
|
|
|
|
defaultValue={this.props.defaultValue}
|
|
|
|
required={this.props.required}
|
|
|
|
onChange={this.handleChange}></textarea>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default InputTextArea;
|