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.4.27 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.26 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.25 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.24 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.23 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.22 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.21 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.20 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.19 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.18 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.17 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.4.16 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js