From cf7a05f80f68b5b1c8bcc0089679dd497cec2506 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Sun, 14 Jun 2015 23:53:32 -0800 Subject: first commit --- web/react/components/more_direct_channels.jsx | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 web/react/components/more_direct_channels.jsx (limited to 'web/react/components/more_direct_channels.jsx') diff --git a/web/react/components/more_direct_channels.jsx b/web/react/components/more_direct_channels.jsx new file mode 100644 index 000000000..2785dc8e0 --- /dev/null +++ b/web/react/components/more_direct_channels.jsx @@ -0,0 +1,68 @@ +// 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 ( + + + ); + } +}); -- cgit v1.2.3-1-g7c22