{this._renderReplies()}
{this._renderAdditionalReplyButton()}
{this._renderReplyForm()}
);
}
/**
* Render reply button if user can reply the comment
* @private
* @returns {Void|DOMElement} - Render the reply button or not if user can reply
*/
_renderReplyButton() {
const { comment: { canHaveReplies }, session } = this.props;
const { showReplyForm } = this.state;
if (session && canHaveReplies) {
return (
);
}
return ;
}
/**
* Render additional reply button if user can reply the comment at the bottom of a conversation
* @private
* @returns {Void|DOMElement} - Render the reply button or not if user can reply
*/
_renderAdditionalReplyButton() {
const { comment: { canHaveReplies, hasReplies }, session, isRootComment } = this.props;
const { showReplyForm } = this.state;
if (session && canHaveReplies) {
if (hasReplies && isRootComment) {
return (
);
}
}
return null;
}
/**
* Render upVote and downVote buttons when the comment is votable
* @private
* @returns {Void|DOMElement} - Render the upVote and downVote buttons or not
*/
_renderVoteButtons() {
const { comment, votable } = this.props;
if (votable) {
return (
);
}
return ;
}
/**
* Render comment replies alternating the css class
* @private
* @returns {Void|DomElement} - A wrapper element with comment replies inside
*/
_renderReplies() {
const { comment: { id, replies }, session, votable, articleClassName } = this.props;
let replyArticleClassName = 'comment comment--nested';
if (articleClassName === 'comment comment--nested') {
replyArticleClassName = `${replyArticleClassName} comment--nested--alt`;
}
if (replies) {
return (