Sha256: 9b6b1926673846873b9d005c141e0785b808869f50d62ce324925f1e599f8fca

Contents?: true

Size: 1.38 KB

Versions: 7

Compression:

Stored size: 1.38 KB

Contents

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

var ChannelsCatalogue = React.createClass({

    handleSelectedChannel: function(ch) {
        this.props.onSelectedChannel(ch);
    },

    render: function() {

        var channels = [];
        var chs = this.props.channels;
        var keys = Object.keys(chs).sort();
        keys = keys.sort(function(a, b) {
            return (+a) - (+b);
        });
        for(var i = 0; i < keys.length; i++) {
            var key = keys[i];

            // set respective selected channel in channels list
            var respectiveSelected = null;
            if(this.props.selectedChannel && key===this.props.selectedChannel.id) {
                respectiveSelected = true;
            }

            channels.push(<ChannelCard
                id={key}
                key={key}
                channelData={chs[key]}
                channelId={key}
                currentSelectedChannel={this.props.selectedChannel}
                respectiveSelected={respectiveSelected}
                onSelectedChannel={this.handleSelectedChannel} />
            );
        }

        return (
            <div className='content-div'>
                <div className="grid" ref='gridRef' >
                    {channels}
                </div>
            </div>
        )
    }

});

module.exports = ChannelsCatalogue;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
nutella_framework-0.7.3 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.7.2 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.7.1 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.7.0 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.6.21 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.6.20 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js
nutella_framework-0.6.19 framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js