diff options
author | Corey Hulen <corey@hulen.com> | 2015-09-02 12:41:28 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-09-02 12:41:28 -0700 |
commit | f9dd82253cb64b2508d2ac21821b5108354a3fb0 (patch) | |
tree | 48cd35a5b439d46821bde5e4534d467704b1bbbe /web/react/components/post_header.jsx | |
parent | 833f6b7df123f25d5aa6bee6aee0c90c82b74c38 (diff) | |
parent | b9e16f41f161c772e1701c4ac47ca5319c706912 (diff) | |
download | chat-f9dd82253cb64b2508d2ac21821b5108354a3fb0.tar.gz chat-f9dd82253cb64b2508d2ac21821b5108354a3fb0.tar.bz2 chat-f9dd82253cb64b2508d2ac21821b5108354a3fb0.zip |
Merge pull request #545 from mattermost/mm-2066
MM-2066 Refactoring for style guide
Diffstat (limited to 'web/react/components/post_header.jsx')
-rw-r--r-- | web/react/components/post_header.jsx | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/web/react/components/post_header.jsx b/web/react/components/post_header.jsx index 129db6d14..9dc525e03 100644 --- a/web/react/components/post_header.jsx +++ b/web/react/components/post_header.jsx @@ -1,23 +1,42 @@ // Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. -var UserProfile = require( './user_profile.jsx' ); +var UserProfile = require('./user_profile.jsx'); var PostInfo = require('./post_info.jsx'); -module.exports = React.createClass({ - getInitialState: function() { - return { }; - }, - render: function() { +export default class PostHeader extends React.Component { + constructor(props) { + super(props); + this.state = {}; + } + render() { var post = this.props.post; return ( - <ul className="post-header post-header-post"> - <li className="post-header-col post-header__name"><strong><UserProfile userId={post.user_id} /></strong></li> - <li className="post-info--hidden"> - <PostInfo post={post} commentCount={this.props.commentCount} handleCommentClick={this.props.handleCommentClick} allowReply="true" isLastComment={this.props.isLastComment} /> + <ul className='post-header post-header-post'> + <li className='post-header-col post-header__name'><strong><UserProfile userId={post.user_id} /></strong></li> + <li className='post-info--hidden'> + <PostInfo + post={post} + commentCount={this.props.commentCount} + handleCommentClick={this.props.handleCommentClick} + allowReply='true' + isLastComment={this.props.isLastComment} + /> </li> </ul> ); } -}); +} + +PostHeader.defaultProps = { + post: null, + commentCount: 0, + isLastComment: false +}; +PostHeader.propTypes = { + post: React.PropTypes.object, + commentCount: React.PropTypes.number, + isLastComment: React.PropTypes.bool, + handleCommentClick: React.PropTypes.func +}; |