/* List of movies. Wrapped with the "withList" and "withCurrentUser" containers. */ import Telescope from 'meteor/nova:lib'; import React, { PropTypes, Component } from 'react'; import NovaForm from "meteor/nova:forms"; import { Button } from 'react-bootstrap'; import { Accounts } from 'meteor/std:accounts-ui'; import { ModalTrigger } from "meteor/nova:core"; import MoviesItem from './MoviesItem.jsx'; import Movies from '../collection.js'; import MoviesNewForm from './MoviesNewForm.jsx'; import { compose } from 'react-apollo'; import { withCurrentUser, withList } from 'meteor/nova:core'; const LoadMore = props => Load More ({props.count}/{props.totalCount}) class MoviesList extends Component { renderNew() { const component = (
Add Movie} >
) return !!this.props.currentUser ? component : null; } render() { if (this.props.loading) { return

Loading…

} else { const hasMore = this.props.totalCount > this.props.results.length; return (
{this.renderNew()} {this.props.results.map(movie => )} {hasMore ? :

No more movies

}
) } } }; const listOptions = { collection: Movies, queryName: 'moviesListQuery', }; export default compose(withList(listOptions), withCurrentUser)(MoviesList);