2015-10-08 12:27:09 -04:00
|
|
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
2015-06-14 23:53:32 -08:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
2015-09-14 11:48:07 -04:00
|
|
|
var TextFormatting = require('../utils/text_formatting.jsx');
|
2015-06-14 23:53:32 -08:00
|
|
|
|
2015-08-31 09:35:31 -07:00
|
|
|
export default class MessageWrapper extends React.Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {};
|
|
|
|
|
}
|
|
|
|
|
render() {
|
2015-06-14 23:53:32 -08:00
|
|
|
if (this.props.message) {
|
2015-09-14 11:48:07 -04:00
|
|
|
return <div dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.message, this.props.options)}}/>;
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
2015-08-31 09:35:31 -07:00
|
|
|
|
|
|
|
|
return <div/>;
|
2015-06-14 23:53:32 -08:00
|
|
|
}
|
2015-08-31 09:35:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MessageWrapper.defaultProps = {
|
2015-09-14 11:48:07 -04:00
|
|
|
message: ''
|
2015-08-31 09:35:31 -07:00
|
|
|
};
|
|
|
|
|
MessageWrapper.propTypes = {
|
|
|
|
|
message: React.PropTypes.string,
|
|
|
|
|
options: React.PropTypes.object
|
|
|
|
|
};
|