var React = require('react'); var Mui = require('material-ui'); var Paper = Mui.Paper; /** * @prop selectedChannel * @prop channels */ var ChannelCard = React.createClass({ handleSelectCard: function() { if(this.props.currentSelectedChannel && this.props.currentSelectedChannel.id === this.props.channelId) { this.props.onSelectedChannel(null); } else { // set selected channel (state) var newSelected = { id: this.props.channelId, belongsTo: 'channels', imgNode: null, channel: null, channelData: this.props.channelData }; this.props.onSelectedChannel(newSelected); } }, render: function() { var style = { backgroundImage: 'url(' + this.props.channelData.screenshot + ')', backgroundSize: '100% 100%' }; if(this.props.currentSelectedChannel) { if(this.props.currentSelectedChannel.id !== this.props.channelId) { style.opacity = '0.5'; } } var iconStyle = { backgroundColor: this.props.channelData.icon }; var description =

{this.props.channelData.description}

; return (

{this.props.channelData.name}

); } }); module.exports = ChannelCard;