Skip to content

Commit

Permalink
Simplify comment statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Dec 27, 2018
1 parent 110ba23 commit 19e4b27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/app/class/Comment.js
@@ -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;
}
}
3 changes: 1 addition & 2 deletions src/app/components/ItemComponent.jsx
Expand Up @@ -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>
Expand Down

0 comments on commit 19e4b27

Please sign in to comment.