// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. var ChannelStore = require('../stores/channel_store.jsx'); var utils = require('../utils/utils.jsx'); module.exports = React.createClass({ componentDidMount: function() { var self = this; $(this.refs.modal.getDOMNode()).on('show.bs.modal', function(e) { var button = e.relatedTarget; self.setState({ channels: $(button).data('channels') }); }); }, getInitialState: function() { return { channels: [] }; }, render: function() { var self = this; var directMessageItems = this.state.channels.map(function(channel) { var badge = ""; var titleClass = "" if (!channel.fake) { var active = channel.id === ChannelStore.getCurrentId() ? "active" : ""; if (channel.unread) { badge = {channel.unread}; badgesActive = true; titleClass = "unread-title" } return (
  • {badge}{channel.display_name}
  • ); } else { return (
  • {badge}{channel.display_name}
  • ); } }); return ( ); } });