Vulcan/packages/nova-base-components/lib/common/App.jsx

36 lines
819 B
React
Raw Normal View History

import React, { PropTypes, Component } from 'react';
2016-05-22 15:23:30 +09:00
import { AppComposer } from "meteor/nova:core";
class App extends Component {
2016-03-24 18:17:35 +09:00
getChildContext() {
2016-03-24 18:17:35 +09:00
return {
currentUser: this.props.currentUser,
currentRoute: this.props.currentRoute
2016-03-24 18:17:35 +09:00
};
}
render() {
if (this.props.ready) {
return <Telescope.components.Layout currentUser={this.props.currentUser}>{this.props.content}</Telescope.components.Layout>
2016-02-16 15:08:30 +09:00
} else {
return <Telescope.components.AppLoading />
2016-02-16 15:08:30 +09:00
}
}
}
App.propTypes = {
ready: React.PropTypes.bool,
currentUser: React.PropTypes.object,
currentRoute: React.PropTypes.object
}
App.childContextTypes = {
currentUser: React.PropTypes.object,
currentRoute: React.PropTypes.object
}
2016-03-27 16:32:29 +09:00
module.exports = AppComposer(App);
export default AppComposer(App);