import React, { PropTypes, Component } from 'react'; import moment from 'moment'; class CustomPostsItem extends Telescope.components.PostsItem { render() { ({UsersAvatar, UsersName, Vote, PostsStats, PostsThumbnail} = Telescope.components); const post = this.props.post; let postClass = "posts-item"; if (post.sticky) postClass += " post-sticky"; // ⭐ custom code starts here ⭐ if (post.color) { postClass += " post-"+post.color; } // ⭐ custom code ends here ⭐ return (
{post.thumbnailUrl ? : null}

{post.title} {this.renderCategories()}

{post.user?
: null}
{moment(post.postedAt).fromNow()}
{post.commentCount} comments
{this.renderActions()}
{this.renderCommenters()}
) } }; export default CustomPostsItem;