var React = require('react');
var ReactBootstrap = require('react-bootstrap');
var Jumbotron = ReactBootstrap.Jumbotron;
var Tabs = ReactBootstrap.Tabs;
var Tab = ReactBootstrap.Tab;
var Modal = ReactBootstrap.Modal;
var TopBarContainer = require('../containers/TopBarContainer');
var RecordLunchContainer = require('../containers/RecordLunchContainer');
var AccountSettingsModalContainer = require('../containers/AccountSettingsModalContainer');
var LunchStatsContainer = require('../containers/LunchStatsContainer');
var NewUserModalContainer = require('../containers/NewUserModalContainer');
var NewGroupModalContainer = require('../containers/NewGroupModalContainer');
module.exports = React.createClass({
displayName: "LunchApp",
getInitialState: function() {
return {
showNewUserModal: false,
showNewGroupModal: false,
showAccountSettingsModal: false
};
},
componentDidMount: function() {
this.props.tryResumingSession();
this.props.fetchGroups();
},
handleAccountSettings: function() {
this.setState({showAccountSettingsModal: true});
},
handleSettingsSubmitted: function(user) {
this.setState({showAccountSettingsModal: false});
},
handleSettingsCanceled: function() {
this.setState({showAccountSettingsModal: false});
},
handleCreateNewUser: function() {
this.setState({showNewUserModal: true});
},
handleNewUserCreated: function() {
this.setState({showNewUserModal: false});
},
handleNewUserCanceled: function() {
this.setState({showNewUserModal: false});
},
handleCreateNewGroup: function() {
this.setState({showNewGroupModal: true});
},
handleNewGroupCreated: function() {
this.setState({showNewGroupModal: false});
},
handleNewGroupCanceled: function() {
this.setState({showNewGroupModal: false});
},
render: function() {
var mainContent;
if (this.props.user.isUser())
mainContent = (
Lunch App