import Telescope from 'meteor/nova:lib'; import { ModalTrigger } from "meteor/nova:core"; import Posts from "meteor/nova:posts"; import React, { PropTypes, Component } from 'react'; import { FormattedMessage, FormattedRelative } from 'react-intl'; import { Link } from 'react-router'; // import { Button } from 'react-bootstrap'; // import moment from 'moment'; // import Users from 'meteor/nova:users'; class PostsItem extends Component { renderCategories() { return this.props.post.categoriesArray ? : ""; } renderCommenters() { return this.props.post.commentersArray ? : ""; } renderActions() { return (
}>
) } render() { const post = this.props.post; let postClass = "posts-item"; if (post.sticky) postClass += " posts-sticky"; // console.log(post) // console.log(post.user) return (
{post.thumbnailUrl ? : null}

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

{post.user?
: null}
{post.postedAt ? : }
{this.context.currentUser && this.context.currentUser.isAdmin ? : null} {this.renderActions()}
{this.renderCommenters()}
) } } PostsItem.propTypes = { post: React.PropTypes.object.isRequired } PostsItem.contextTypes = { currentUser: React.PropTypes.object }; module.exports = PostsItem; export default PostsItem;