2016-10-28 15:45:43 +09:00
|
|
|
import Telescope from 'meteor/nova:lib';
|
|
|
|
import React from 'react';
|
|
|
|
import Posts from "meteor/nova:posts";
|
2016-11-02 19:04:34 +09:00
|
|
|
import Events from "meteor/nova:events";
|
2016-10-28 15:45:43 +09:00
|
|
|
|
|
|
|
import { graphql } from 'react-apollo';
|
|
|
|
import gql from 'graphql-tag';
|
|
|
|
|
|
|
|
const AppContainer = (props, context) => {
|
|
|
|
|
2016-11-10 10:54:43 +01:00
|
|
|
const {loading, currentUser} = props.data;
|
2016-11-10 10:11:43 +09:00
|
|
|
|
2016-10-28 15:45:43 +09:00
|
|
|
return <Telescope.components.App
|
2016-11-10 10:54:43 +01:00
|
|
|
loading={loading}
|
2016-10-29 14:18:16 +09:00
|
|
|
currentUser={currentUser}
|
2016-11-02 19:04:34 +09:00
|
|
|
events={Events}
|
2016-10-28 15:45:43 +09:00
|
|
|
{...props}
|
|
|
|
/>;
|
|
|
|
};
|
|
|
|
|
|
|
|
AppContainer.propTypes = {
|
|
|
|
data: React.PropTypes.shape({
|
|
|
|
loading: React.PropTypes.bool,
|
2016-10-28 13:56:07 +02:00
|
|
|
currentUser: React.PropTypes.object,
|
2016-10-28 15:45:43 +09:00
|
|
|
}).isRequired,
|
|
|
|
params: React.PropTypes.object
|
|
|
|
};
|
|
|
|
|
|
|
|
AppContainer.displayName = "AppContainer";
|
|
|
|
|
|
|
|
const AppContainerWithData = graphql(gql`
|
|
|
|
query getAppData {
|
2016-11-10 10:54:43 +01:00
|
|
|
currentUser {
|
2016-10-28 15:45:43 +09:00
|
|
|
_id
|
2016-11-10 10:54:43 +01:00
|
|
|
username
|
|
|
|
createdAt
|
|
|
|
isAdmin
|
2016-11-10 14:22:47 +01:00
|
|
|
__bio
|
|
|
|
__commentCount
|
|
|
|
__displayName
|
|
|
|
__downvotedComments {
|
2016-11-10 10:54:43 +01:00
|
|
|
itemId
|
|
|
|
power
|
|
|
|
votedAt
|
|
|
|
}
|
2016-11-10 14:22:47 +01:00
|
|
|
__downvotedPosts {
|
2016-11-10 10:54:43 +01:00
|
|
|
itemId
|
|
|
|
power
|
|
|
|
votedAt
|
|
|
|
}
|
2016-11-10 14:22:47 +01:00
|
|
|
__email
|
|
|
|
__emailHash
|
|
|
|
__htmlBio
|
|
|
|
__karma
|
|
|
|
__postCount
|
|
|
|
__slug
|
|
|
|
__twitterUsername
|
|
|
|
__upvotedComments {
|
2016-11-10 10:54:43 +01:00
|
|
|
itemId
|
|
|
|
power
|
|
|
|
votedAt
|
|
|
|
}
|
2016-11-10 14:22:47 +01:00
|
|
|
__upvotedPosts {
|
2016-11-10 10:54:43 +01:00
|
|
|
itemId
|
|
|
|
power
|
|
|
|
votedAt
|
|
|
|
}
|
2016-11-10 14:22:47 +01:00
|
|
|
__website
|
|
|
|
__groups
|
|
|
|
__notifications_users
|
|
|
|
__notifications_posts
|
|
|
|
__newsletter_subscribeToNewsletter
|
2016-10-28 15:45:43 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
`, {
|
|
|
|
options(ownProps) {
|
|
|
|
return {
|
|
|
|
variables: {},
|
2016-11-02 19:56:44 +09:00
|
|
|
// pollInterval: 20000,
|
2016-10-28 15:45:43 +09:00
|
|
|
};
|
|
|
|
},
|
|
|
|
})(AppContainer);
|
|
|
|
|
2016-11-10 10:54:43 +01:00
|
|
|
module.exports = AppContainerWithData;
|