Sha256: 173afa5aa1b1862b5da076ba0f0d012054a1cee661da0a14a99fa73f2cc0de8d

Contents?: true

Size: 1.83 KB

Versions: 32

Compression:

Stored size: 1.83 KB

Contents

var React = require('react');
var Mui = require('material-ui');
var RaisedButton_ = require('./material-ui/raised-button_.jsx');
var ContextButton = require('./ContextButton');
var GlobalButton = require('./GlobalButton');

/**
 * @prop familyName
 * @prop selectedChannel
 * @prop onRemovedAllChannels
 * @prop onAddedChannelToPool
 * @prop onRemovedChannelFromPool
 */
var PoolHeader = React.createClass({

    handleAddedChannel: function(chId) {
        this.props.onAddedChannelToPool(chId);
    },

    handleRemovedChannel: function(chId) {
        this.props.onRemovedChannelFromPool(chId);
    },

    handleRemovedChannels: function() {
        this.props.onRemovedAllChannels();
    },

    render: function() {

        var buttonStyle = {
            marginRight:'10px'
        };

        var buttonAdd, buttonRemove, headerButtons;
        if(this.props.selectedChannel) {
            buttonAdd = <ContextButton
                type='add'
                onAddedChannel={this.handleAddedChannel}
                selectedChannel={this.props.selectedChannel} />;
            buttonRemove = <ContextButton
                type='remove'
                onRemovedChannel={this.handleRemovedChannel}
                selectedChannel={this.props.selectedChannel} />;
            headerButtons = <th>
                    {buttonAdd}
                    {buttonRemove}
            </th>
        } else {
            buttonRemove = <GlobalButton type='remove' onRemovedChannels={this.handleRemovedChannels} />;
            headerButtons = <th>
                    {buttonRemove}
            </th>
        }

        return (

            <tr className='pool-header'>
                <th></th>
                <th> {this.props.familyName} </th>
                    {headerButtons}
                <th></th>
            </tr>);

    }
});

module.exports = PoolHeader;

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
nutella_framework-0.6.12 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.11 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.10 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.9 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.8 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.7 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.6 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.5 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.4 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.3 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.2 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.1 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.0 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.5.1 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.5.0 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.32 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.31 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.30 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.29 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.28 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js