// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.
var UserStore = require('../stores/user_store.jsx');
var utils = require('../utils/utils.jsx');
module.exports = React.createClass({
componentDidMount: function() {
UserStore.addStatusesChangeListener(this._onChange);
},
componentWillUnmount: function() {
UserStore.removeStatusesChangeListener(this._onChange);
},
_onChange: function() {
this.forceUpdate();
},
getInitialState: function() {
return { };
},
render: function() {
var post = this.props.post;
var isOwner = UserStore.getCurrentId() == post.user_id;
var type = "Post"
if (post.root_id.length > 0) {
type = "Comment"
}
var comments = "";
var lastCommentClass = this.props.isLastComment ? " comment-icon__container__show" : " comment-icon__container__hide";
if (this.props.commentCount >= 1) {
comments =