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

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

{post.user?
: null}
{post.postedAt ? : }
{this.props.currentUser && this.props.currentUser.isAdmin ? : null} {this.renderActions()}
{this.renderCommenters()}
) } }; PostsItem.propTypes = { currentUser: React.PropTypes.object, post: React.PropTypes.object.isRequired, }; Telescope.registerComponent('PostsItem', PostsItem, withCurrentUser);