diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-09 13:44:28 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-09 13:44:28 -0700 |
commit | 04b80b6a25cddce0a44da1409ddc430bc8e797f5 (patch) | |
tree | 90d57d50ec325e6b4f26608d4c3c20e1e21ce11e /web/react/components/more_channels.jsx | |
parent | 38532013fa7e9b152d3750d73c149ff727881342 (diff) | |
parent | 763618ef3613d0af6baea0e1d49abb6641979841 (diff) | |
download | chat-04b80b6a25cddce0a44da1409ddc430bc8e797f5.tar.gz chat-04b80b6a25cddce0a44da1409ddc430bc8e797f5.tar.bz2 chat-04b80b6a25cddce0a44da1409ddc430bc8e797f5.zip |
Merge branch 'master' of https://github.com/mattermost/platform into MM-831
merge
Diffstat (limited to 'web/react/components/more_channels.jsx')
-rw-r--r-- | web/react/components/more_channels.jsx | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/web/react/components/more_channels.jsx b/web/react/components/more_channels.jsx index be2a5e93c..1af259853 100644 --- a/web/react/components/more_channels.jsx +++ b/web/react/components/more_channels.jsx @@ -61,6 +61,10 @@ module.exports = React.createClass({ render: function() { var server_error = this.state.server_error ? <div className='form-group has-error'><label className='control-label'>{ this.state.server_error }</label></div> : null; var outter = this; + var moreChannels; + + if (this.state.channels != null) + moreChannels = this.state.channels; return ( <div className="modal fade" id="more_channels" ref="modal" tabIndex="-1" role="dialog" aria-hidden="true"> @@ -75,26 +79,36 @@ module.exports = React.createClass({ <button data-toggle="modal" data-target="#new_channel" data-channeltype={this.state.channel_type} type="button" className="btn btn-primary channel-create-btn" onClick={this.handleNewChannel}>Create New Channel</button> </div> <div className="modal-body"> - {this.state.channels.length ? - <table className="more-channel-table table"> - <tbody> - {this.state.channels.map(function(channel) { - return ( - <tr key={channel.id}> - <td> - <p className="more-channel-name">{channel.display_name}</p> - <p className="more-channel-description">{channel.description}</p> - </td> - <td className="td--action"><button onClick={outter.handleJoin.bind(outter, channel.id)} className="pull-right btn btn-primary">Join</button></td> - </tr> - ) - })} - </tbody> - </table> - : <div className="no-channel-message"> - <p className="primary-message">No more channels to join</p> - <p className="secondary-message">Click 'Create New Channel' to make a new one</p> - </div>} + {moreChannels ? + (moreChannels.length ? + <table className="more-channel-table table"> + <tbody> + {moreChannels.map(function(channel) { + return ( + <tr key={channel.id}> + <td> + <p className="more-channel-name">{channel.display_name}</p> + <p className="more-channel-description">{channel.description}</p> + </td> + <td className="td--action"><button onClick={outter.handleJoin.bind(outter, channel.id)} className="pull-right btn btn-primary">Join</button></td> + </tr> + ) + })} + </tbody> + </table> + : <div className="no-channel-message"> + <p className="primary-message">No more channels to join</p> + <p className="secondary-message">Click 'Create New Channel' to make a new one</p> + </div>) + : <div ref="loadingscreen" className="loading-screen loading-screen--channel"> + <div className="loading__content"> + <h3>Loading</h3> + <div id="round_1" className="round"></div> + <div id="round_2" className="round"></div> + <div id="round_3" className="round"></div> + </div> + </div> + } { server_error } </div> <div className="modal-footer"> |