import Telescope from 'meteor/nova:lib'; import React from 'react'; import { withPostsList } from 'meteor/nova:base-containers'; const PostsList = (props) => { const {results, terms, loading, count, totalCount, loadMore, showHeader = true} = props if (results && results.length) { const hasMore = totalCount > results.length; return (
{showHeader ? : null}
{results.map(post => )}
{hasMore ? (loading ? : ) : }
) } else if (loading) { return (
{showHeader ? : null}
) } else { return (
{showHeader ? : null}
) } }; PostsList.displayName = "PostsList"; PostsList.propTypes = { results: React.PropTypes.array, terms: React.PropTypes.object, hasMore: React.PropTypes.bool, loading: React.PropTypes.bool, count: React.PropTypes.number, totalCount: React.PropTypes.number, loadMore: React.PropTypes.func, showHeader: React.PropTypes.bool, }; module.exports = withPostsList()(PostsList);