summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-09-01 09:23:58 -0400
committerJoramWilander <jwawilander@gmail.com>2015-09-01 09:23:58 -0400
commitdad4dbed7e85508b3de9cc7bad948c3f50ddb476 (patch)
tree1fe0d6db86df78b338d38da4609fcd9dccdb1ad5 /web
parente8324e725ab0c8cb49ed94553d55671ff9183bed (diff)
downloadchat-dad4dbed7e85508b3de9cc7bad948c3f50ddb476.tar.gz
chat-dad4dbed7e85508b3de9cc7bad948c3f50ddb476.tar.bz2
chat-dad4dbed7e85508b3de9cc7bad948c3f50ddb476.zip
Reformatted post_header.jsx to meet style guide requirements.
Diffstat (limited to 'web')
-rw-r--r--web/react/components/post_header.jsx41
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
+};