Sha256: e75219d866dfc3fbce35df9738f3c86563c2925bf0e639efcd23b8702cde9f32

Contents?: true

Size: 1.26 KB

Versions: 18

Compression:

Stored size: 1.26 KB

Contents

var React = require('react');
var Mui = require('material-ui');

var Login = require('./login/main');
var App = require('./app/main');
var NUTELLA = require('nutella_lib');

var Main = React.createClass({

    componentDidMount: function() {

    },

    getInitialState: function () {
        return  {
            page: 1,
            params: undefined
        }
    },

    setPage: function(page) {
        this.setState({
            page: page
        });
    },

    handleSwitchPage: function(page, params) {
        if(params) {
            if(params) {
                this.setState({
                    page: page,
                    params: params
                });
            }
        } else {
            this.setState({
                page: page
            });
        }
    },

    render: function () {

        var page = null;
        switch(this.state.page) {
            case 1:
                page = <Login
                    onSwitchPage={this.handleSwitchPage} />;
                break;
            case 2:
                page = <App
                    onSwitchPage={this.handleSwitchPage}
                    params={this.state.params} />;
                break;
            default:
        }

        return page;
    }

});

module.exports = Main;

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
nutella_framework-0.7.3 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.7.2 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.7.1 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.7.0 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.21 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.20 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.19 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.18 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.17 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.16 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.15 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.13 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.12 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.11 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.10 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.9 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.8 framework_components/roomcast-main-app/src/app/components/main.js
nutella_framework-0.6.7 framework_components/roomcast-main-app/src/app/components/main.js