Vulcan/packages/nova-core/lib/containers/AppContainer.jsx

36 lines
677 B
React
Raw Normal View History

const AppContainer = React.createClass({
2016-02-16 15:08:30 +09:00
mixins: [ReactMeteorData],
2016-02-16 15:08:30 +09:00
getMeteorData() {
2016-02-16 15:08:30 +09:00
var data = {
ready: false
};
2016-02-16 15:08:30 +09:00
var handles = Telescope.subscriptions.map((sub) => Meteor.subscribe(sub.name, sub.arguments));
2016-02-16 15:08:30 +09:00
if(!handles.length || _.every(handles, handle => handle.ready())) {
data.ready = true;
}
2016-02-16 15:08:30 +09:00
return data;
},
render() {
2016-02-16 15:08:30 +09:00
const Layout = Telescope.getComponent("Layout");
if (this.data.ready) {
return <Layout>{this.props.content}</Layout>
} else {
return <p>Loading App</p>
}
// return this.data.ready ? this.props.content : <Loading/>;
}
});
module.exports = AppContainer;