/* An item in the movies list. Wrapped with the "withCurrentUser" container. */ import React, { PropTypes, Component } from 'react'; import { Button } from 'react-bootstrap'; import { ModalTrigger } from 'meteor/nova:core'; import MoviesEditForm from './MoviesEditForm.jsx'; import MoviesDetails from './MoviesDetails.jsx'; import { withCurrentUser } from 'meteor/nova:core'; import Movies from '../collection.js'; class MoviesItem extends Component { renderDetails() { const movie = this.props; return (
Read Review} >
) } renderEdit() { const movie = this.props; return (
Edit Movie} >
) } render() { const movie = this.props; return (

{movie.name} ({movie.year})

By {movie.user && movie.user.__displayName}

{this.renderDetails()} {Movies.options.mutations.edit.check(this.props.currentUser, movie) ? this.renderEdit() : null}
) } }; export default withCurrentUser(MoviesItem);