Removing dynamic containers from CommentStream

This commit is contained in:
David Jay
2016-11-01 16:00:33 -07:00
parent 022982aeb8
commit d64aea5fa0
9 changed files with 81 additions and 756 deletions
@@ -2,14 +2,16 @@ import React from 'react'
const name = 'coral-plugin-comment-count'
const CommentCount = ({comment}) => {
const CommentCount = ({items, item_id}) => {
let count = 0
if (comment) {
count += comment.length
for (var i=0; i < comment.length; i++) {
if (comment[i].child) {
count += comment[i].child.length
}
if (items[item_id]) {
count += items[item_id].related.comment.length
}
const itemKeys = Object.keys(items)
for (var i=0; i < itemKeys.length; i++) {
const item = items[itemKeys[i]]
if (item.type === 'comment' && item.related && item.related.child) {
count += item.related.child.length
}
}