diff --git a/pkg/interface/publish/src/js/components/lib/comment-item.js b/pkg/interface/publish/src/js/components/lib/comment-item.js index 8fd2340326..1619c62177 100644 --- a/pkg/interface/publish/src/js/components/lib/comment-item.js +++ b/pkg/interface/publish/src/js/components/lib/comment-item.js @@ -1,7 +1,8 @@ import React, { Component } from 'react'; import moment from 'moment'; +import { Sigil } from './icons/sigil'; +import { uxToHex } from '../../lib/util'; -//TODO take props and render div export class CommentItem extends Component { constructor(props){ super(props); @@ -36,12 +37,31 @@ export class CommentItem extends Component { }); let date = moment(commentData["date-created"]).fromNow(); + let contact = !!(commentData.author.substr(1) in this.props.contacts) + ? this.props.contacts[commentData.author.substr(1)] : false; + + let name = commentData.author; + let color = "#000000"; + if (contact) { + name = (contact.nickname.length > 0) + ? contact.nickname : commentData.author; + color = `#${uxToHex(contact.color)}`; + } + return (
{props.title}
-by {props.author}
+by + + {name} + +
{postCount}
diff --git a/pkg/interface/publish/src/js/components/lib/notebook-posts.js b/pkg/interface/publish/src/js/components/lib/notebook-posts.js
index f9cedb175d..5a78599283 100644
--- a/pkg/interface/publish/src/js/components/lib/notebook-posts.js
+++ b/pkg/interface/publish/src/js/components/lib/notebook-posts.js
@@ -30,14 +30,24 @@ export class NotebookPosts extends Component {
}
render() {
+ const { props } = this;
let notes = [];
- for (var i=0; i {note.snippet} {notebook.about}