Sha256: e35555f52474622dc4992c969c7c5e77d2bdd332426d152b4fda266ebd540c34

Contents?: true

Size: 1.83 KB

Versions: 12

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-all' 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

12 entries across 12 versions & 1 rubygems

Version Path
nutella_framework-0.7.3 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.7.2 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.7.1 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.7.0 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.21 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.20 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.19 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.18 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.17 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.16 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.15 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js
nutella_framework-0.6.13 framework_components/roomcast-package-creator/src/app/components/PoolHeader.js