diff --git a/webclient/src/Comments.js b/webclient/src/Comments.js index 633b6f5..1e02d8d 100644 --- a/webclient/src/Comments.js +++ b/webclient/src/Comments.js @@ -72,7 +72,7 @@ class Article extends React.Component { } displayComment(story, c, level) { - const cid = c.author+c.date; + const cid = c.author + c.date; const collapsed = this.state.collapsed.includes(cid); const expanded = this.state.expanded.includes(cid); @@ -85,19 +85,22 @@ class Article extends React.Component {

{c.author === story.author ? '[OP]' : ''} {c.author || '[Deleted]'} - {' '} | {moment.unix(c.date).fromNow()} + {' '} | {moment.unix(c.date).fromNow()} - {hidden || hasChildren && - this.collapseComment(cid)}>– - } + {hasChildren && ( + hidden ? + this.collapseComment(cid)}>– + : + this.expandComment(cid)}>+ + )}

-
+
{hidden && hasChildren ? -
this.expandComment(cid)}>[show {this.countComments(c)-1} more]
- : +
this.expandComment(cid)}>[show {this.countComments(c) - 1} more]
+ : c.comments.map(i => this.displayComment(story, i, level + 1)) }
@@ -130,7 +133,7 @@ class Article extends React.Component { {story.comments.map(c => this.displayComment(story, c, 0))}
- : + :

loading...

}