diff --git a/web/react/components/more_channels.jsx b/web/react/components/more_channels.jsx
index db61e5f49e..3309ef52ed 100644
--- a/web/react/components/more_channels.jsx
+++ b/web/react/components/more_channels.jsx
@@ -1,7 +1,7 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import * as utils from '../utils/utils.jsx';
+import * as Utils from '../utils/utils.jsx';
import * as client from '../utils/client.jsx';
import * as AsyncClient from '../utils/async_client.jsx';
import ChannelStore from '../stores/channel_store.jsx';
@@ -24,6 +24,7 @@ export default class MoreChannels extends React.Component {
this.onListenerChange = this.onListenerChange.bind(this);
this.handleJoin = this.handleJoin.bind(this);
this.handleNewChannel = this.handleNewChannel.bind(this);
+ this.createChannelRow = this.createChannelRow.bind(this);
var initState = getStateFromStores();
initState.channelType = '';
@@ -48,7 +49,7 @@ export default class MoreChannels extends React.Component {
}
onListenerChange() {
var newState = getStateFromStores();
- if (!utils.areObjectsEqual(newState.channels, this.state.channels)) {
+ if (!Utils.areObjectsEqual(newState.channels, this.state.channels)) {
this.setState(newState);
}
}
@@ -58,7 +59,7 @@ export default class MoreChannels extends React.Component {
() => {
$(ReactDOM.findDOMNode(this.refs.modal)).modal('hide');
AsyncClient.getChannel(channel.id);
- utils.switchChannel(channel);
+ Utils.switchChannel(channel);
this.setState({joiningChannel: -1});
},
(err) => {
@@ -70,13 +71,54 @@ export default class MoreChannels extends React.Component {
$(ReactDOM.findDOMNode(this.refs.modal)).modal('hide');
this.setState({showNewChannelModal: true});
}
+ createChannelRow(channel, index) {
+ let joinButton;
+ if (this.state.joiningChannel === index) {
+ joinButton = (
+
+ );
+ } else {
+ joinButton = (
+
+ );
+ }
+
+ return (
+
{channel.display_name}
+{channel.purpose}
+|
- {channel.display_name} -{channel.purpose} - |
- - {joinButton} - | -
-
-
+
+