Permalink
Browse files

Simplify comment statuses

  • Loading branch information...
marcomontalbano committed Dec 27, 2018
1 parent 110ba23 commit 19e4b27c6b619ab83fb4bfbeaea975f7c3c8792c
Showing with 3 additions and 5 deletions.
  1. +2 −3 src/app/class/Comment.js
  2. +1 −2 src/app/components/ItemComponent.jsx
@@ -1,10 +1,9 @@
export default class Comment {
constructor({ date = '', name = '', author = '', message = '', prevstatus = '', nextstatus = '' }) {
constructor({ date = '', name = '', author = '', message = '', status = '' }) {
this.date = date;
this.name = name;
this.author = author;
this.message = message;
this.prevstatus = prevstatus;
this.nextstatus = nextstatus;
this.status = status;
}
}
@@ -53,14 +53,13 @@ export default class ItemComponent extends Component {

renderComments() {
const comments = _.map(this.props.item.comments, (comment, key) => {
const changedStatus = _.isEmpty(comment.prevstatus) && _.isEmpty(comment.nextstatus) ? '' : (<div>{this.renderLabel(comment.prevstatus)} <i className="fa fa-arrow-right" aria-hidden="true"></i> {this.renderLabel(comment.nextstatus)}</div>);
return (
<li key={key}>
<article className="uk-comment">
<div className="uk-comment-body">
<div><small>{comment.date}</small></div>
<div className="uk-text-bold uk-text-primary">{comment.author}</div>
{changedStatus}
{this.renderLabel(comment.status)}
<div className="uk-margin-small-top">{comment.message}</div>
</div>
</article>

0 comments on commit 19e4b27

Please sign in to comment.