From d144cea6dd64d8bdad83e5ef71bc22d1ff8d75e7 Mon Sep 17 00:00:00 2001 From: Philip Schatz Date: Tue, 26 Jan 2016 14:51:35 -0500 Subject: [PATCH] add comment count --- src/components/issue.jsx | 19 ++++++++++++++++--- style/app.less | 9 +++++++-- webpack.config.js | 4 ++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/components/issue.jsx b/src/components/issue.jsx index fea7b7c..6873bd6 100644 --- a/src/components/issue.jsx +++ b/src/components/issue.jsx @@ -95,6 +95,9 @@ let Issue = React.createClass({ render() { const {card, primaryRepoName, columnRegExp} = this.props; const {issue, repoOwner, repoName} = card; + if (!issue) { + return (Maybe moving Issue...); + } // TODO: Maybe the following 2 should be methods on the card const {taskFinishedCount, taskTotalCount} = getTaskCounts(issue.body); const issueDueAt = getIssueDueAt(issue.body); @@ -105,9 +108,8 @@ let Issue = React.createClass({ // PR updatedAt is updated when commits are pushed const updatedAt = card.getUpdatedAt(); - if (!issue) { - return (Maybe moving Issue...); - } + const {comments: commentsCount} = issue; // count of comments + const user = issue.assignee ? issue.assignee : issue.user; const assignedAvatar = ( @@ -245,6 +247,16 @@ let Issue = React.createClass({ ); }); + let comments; + if (commentsCount) { + comments = ( + + {commentsCount} + + + ); + } + const header = [