diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-02-22 15:03:04 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-02-22 15:03:04 -0500 |
commit | 12fd1ddc95e1cc5320aa52afe8adc1937a8d606d (patch) | |
tree | 190ea30915892e1bccae86eb9d8d251c3e5ae42b /web/react/components/channel_header.jsx | |
parent | bc69f2aae0cdc030adbebadd51d388d35e63950f (diff) | |
parent | 5ddd227985f5681fb239407397de3784d76bb528 (diff) | |
download | chat-12fd1ddc95e1cc5320aa52afe8adc1937a8d606d.tar.gz chat-12fd1ddc95e1cc5320aa52afe8adc1937a8d606d.tar.bz2 chat-12fd1ddc95e1cc5320aa52afe8adc1937a8d606d.zip |
Merge pull request #2210 from hmhealey/plt1258
PLT-1258 Ported RenameChannelModal to React-Bootstrap
Diffstat (limited to 'web/react/components/channel_header.jsx')
-rw-r--r-- | web/react/components/channel_header.jsx | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx index b5eb546cf..079a9451e 100644 --- a/web/react/components/channel_header.jsx +++ b/web/react/components/channel_header.jsx @@ -11,6 +11,7 @@ import ChannelInviteModal from './channel_invite_modal.jsx'; import ChannelMembersModal from './channel_members_modal.jsx'; import ChannelNotificationsModal from './channel_notifications_modal.jsx'; import DeleteChannelModal from './delete_channel_modal.jsx'; +import RenameChannelModal from './rename_channel_modal.jsx'; import ToggleModalButton from './toggle_modal_button.jsx'; import ChannelStore from '../stores/channel_store.jsx'; @@ -39,10 +40,13 @@ export default class ChannelHeader extends React.Component { this.onListenerChange = this.onListenerChange.bind(this); this.handleLeave = this.handleLeave.bind(this); this.searchMentions = this.searchMentions.bind(this); + this.showRenameChannelModal = this.showRenameChannelModal.bind(this); + this.hideRenameChannelModal = this.hideRenameChannelModal.bind(this); const state = this.getStateFromStores(); state.showEditChannelPurposeModal = false; state.showMembersModal = false; + state.showRenameChannelModal = false; this.state = state; } getStateFromStores() { @@ -120,6 +124,18 @@ export default class ChannelHeader extends React.Component { is_mention_search: true }); } + showRenameChannelModal(e) { + e.preventDefault(); + + this.setState({ + showRenameChannelModal: true + }); + } + hideRenameChannelModal() { + this.setState({ + showRenameChannelModal: false + }); + } render() { if (this.state.channel === null) { return null; @@ -326,11 +342,7 @@ export default class ChannelHeader extends React.Component { <a role='menuitem' href='#' - data-toggle='modal' - data-target='#rename_channel' - data-display={channel.display_name} - data-name={channel.name} - data-channelid={channel.id} + onClick={this.showRenameChannelModal} > <FormattedMessage id='channel_header.rename' @@ -470,6 +482,11 @@ export default class ChannelHeader extends React.Component { onModalDismissed={() => this.setState({showMembersModal: false})} channel={channel} /> + <RenameChannelModal + show={this.state.showRenameChannelModal} + onHide={this.hideRenameChannelModal} + channel={channel} + /> </div> ); } |