summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_header.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-04 11:21:14 -0400
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-04 11:21:14 -0400
commite6f7a47c99075a39d862308659b904bfaf64a11a (patch)
tree863f6eb80a2367fb080437d9e037fca283e3c270 /webapp/components/channel_header.jsx
parentdbdd719c51d061dfc327644d4b2ca89a0595b4f1 (diff)
downloadchat-e6f7a47c99075a39d862308659b904bfaf64a11a.tar.gz
chat-e6f7a47c99075a39d862308659b904bfaf64a11a.tar.bz2
chat-e6f7a47c99075a39d862308659b904bfaf64a11a.zip
PLT-4507 Don't mount modals until opened to make resetting state automatic (#4358)
* Don't mount modals until opened to make resetting state automatic * Move dimiss handler to be fired after modal exit animation complete
Diffstat (limited to 'webapp/components/channel_header.jsx')
-rw-r--r--webapp/components/channel_header.jsx36
1 files changed, 25 insertions, 11 deletions
diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx
index c7842aaa3..dd0fd5b70 100644
--- a/webapp/components/channel_header.jsx
+++ b/webapp/components/channel_header.jsx
@@ -450,6 +450,7 @@ export default class ChannelHeader extends React.Component {
role='presentation'
>
<ToggleModalButton
+ ref='channelInviteModalButton'
role='menuitem'
dialogType={ChannelInviteModal}
dialogProps={{channel, currentUser: this.state.currentUser}}
@@ -662,6 +663,28 @@ export default class ChannelHeader extends React.Component {
</OverlayTrigger>
);
+ let channelMembersModal;
+ if (this.state.showMembersModal) {
+ channelMembersModal = (
+ <ChannelMembersModal
+ onModalDismissed={() => this.setState({showMembersModal: false})}
+ showInviteModal={() => this.refs.channelInviteModalButton.show()}
+ channel={channel}
+ isAdmin={isAdmin}
+ />
+ );
+ }
+
+ let editPurposeModal;
+ if (this.state.showEditChannelPurposeModal) {
+ editPurposeModal = (
+ <EditChannelPurposeModal
+ onModalDismissed={() => this.setState({showEditChannelPurposeModal: false})}
+ channel={channel}
+ />
+ );
+ }
+
return (
<div
id='channel-header'
@@ -753,17 +776,8 @@ export default class ChannelHeader extends React.Component {
</tr>
</tbody>
</table>
- <EditChannelPurposeModal
- show={this.state.showEditChannelPurposeModal}
- onModalDismissed={() => this.setState({showEditChannelPurposeModal: false})}
- channel={channel}
- />
- <ChannelMembersModal
- show={this.state.showMembersModal}
- onModalDismissed={() => this.setState({showMembersModal: false})}
- channel={channel}
- isAdmin={isAdmin}
- />
+ {editPurposeModal}
+ {channelMembersModal}
<RenameChannelModal
show={this.state.showRenameChannelModal}
onHide={this.hideRenameChannelModal}