mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
27 lines
718 B
React
27 lines
718 B
React
![]() |
import Telescope from 'meteor/nova:lib';
|
||
|
import React, { PropTypes, Component } from 'react';
|
||
|
import Movies from '../collection.js';
|
||
|
import { withSingle } from 'meteor/nova:core';
|
||
|
import { compose } from 'react-apollo';
|
||
|
|
||
|
const MoviesDetails = props => {
|
||
|
const movie = props.document;
|
||
|
if (props.loading) {
|
||
|
return <p>Loading…</p>
|
||
|
} else {
|
||
|
return (
|
||
|
<div>
|
||
|
<h2>{movie.name} ({movie.year})</h2>
|
||
|
<p>Reviewed by <strong>{movie.user && movie.user.__displayName}</strong> on {movie.createdAt}</p>
|
||
|
<p>{movie.review}</p>
|
||
|
</div>
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const options = {
|
||
|
collection: Movies,
|
||
|
queryName: 'moviesSingleQuery',
|
||
|
};
|
||
|
|
||
|
export default compose(withSingle(options))(MoviesDetails);
|