Sha256: 7f1d62a7399144a4512e062a69c6a3fcbe4b2944af8097f86010dd6b39936ab3
Contents?: true
Size: 1.7 KB
Versions: 32
Compression:
Stored size: 1.7 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); }, handleStyleRespectiveChannel: function() { var selected = this.props.selectedChannel; for(ref in this.refs) { console.log(ref, selected); if(this.refs[ref].props.id===selected.id) { console.log(selected.imgNode); break; } } }, render: function() { var channels = []; var chs = this.props.channels; var keys = Object.keys(chs).sort(); 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} /> ); } var backgroundMessage = null; //TODO return ( <div className='content-div'> {backgroundMessage} <div className="grid" ref='gridRef' > {channels} </div> </div> ) } }); module.exports = ChannelsCatalogue;
Version data entries
32 entries across 32 versions & 1 rubygems