mirror of
https://github.com/vale981/Vulcan
synced 2025-03-11 21:16:40 -04:00
33 lines
No EOL
871 B
JavaScript
33 lines
No EOL
871 B
JavaScript
/*
|
||
|
||
An item in the movies list.
|
||
Wrapped with the "withCurrentUser" container.
|
||
|
||
*/
|
||
|
||
import React from 'react';
|
||
import { Components, registerComponent } from 'meteor/vulcan:core';
|
||
|
||
import Movies from '../../modules/movies/collection.js';
|
||
|
||
const MoviesItem = ({movie, currentUser}) =>
|
||
|
||
<div style={{paddingBottom: "15px",marginBottom: "15px", borderBottom: "1px solid #ccc"}}>
|
||
|
||
{/* document properties */}
|
||
|
||
<h4>{movie.name} ({movie.year})</h4>
|
||
<p>{movie.review} – {movie.user && movie.user.displayName}</p>
|
||
|
||
{/* edit document form */}
|
||
|
||
{Movies.options.mutations.edit.check(currentUser, movie) ?
|
||
<Components.ModalTrigger label="Edit Movie">
|
||
<Components.MoviesEditForm currentUser={currentUser} documentId={movie._id} />
|
||
</Components.ModalTrigger>
|
||
: null
|
||
}
|
||
|
||
</div>
|
||
|
||
registerComponent('MoviesItem', MoviesItem); |