diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-11-11 12:53:18 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-11-11 12:53:18 -0500 |
commit | 782709aa56d8e3ad9d65cd05f33640887d771b89 (patch) | |
tree | acf53dd7a00cfa083e4226cd97b63ee3cdbbec48 /web/react/utils/channel_intro_mssages.jsx | |
parent | e32b92052e48a37e7989d89d5969ea9a13ca43ae (diff) | |
download | chat-782709aa56d8e3ad9d65cd05f33640887d771b89.tar.gz chat-782709aa56d8e3ad9d65cd05f33640887d771b89.tar.bz2 chat-782709aa56d8e3ad9d65cd05f33640887d771b89.zip |
Fix channel invite button on channel intro message and fix empty channel invite modal.
Diffstat (limited to 'web/react/utils/channel_intro_mssages.jsx')
-rw-r--r-- | web/react/utils/channel_intro_mssages.jsx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/web/react/utils/channel_intro_mssages.jsx b/web/react/utils/channel_intro_mssages.jsx index 161c79761..87dc680c1 100644 --- a/web/react/utils/channel_intro_mssages.jsx +++ b/web/react/utils/channel_intro_mssages.jsx @@ -9,15 +9,15 @@ const ChannelStore = require('../stores/channel_store.jsx'); const Constants = require('../utils/constants.jsx'); const TeamStore = require('../stores/team_store.jsx'); -export function createChannelIntroMessage(channel) { +export function createChannelIntroMessage(channel, showInviteModal) { if (channel.type === 'D') { - return createDMIntroMessage(channel); + return createDMIntroMessage(channel, showInviteModal); } else if (ChannelStore.isDefault(channel)) { return createDefaultIntroMessage(channel); } else if (channel.name === Constants.OFFTOPIC_CHANNEL) { - return createOffTopicIntroMessage(channel); + return createOffTopicIntroMessage(channel, showInviteModal); } else if (channel.type === 'O' || channel.type === 'P') { - return createStandardIntroMessage(channel); + return createStandardIntroMessage(channel, showInviteModal); } } @@ -71,7 +71,7 @@ export function createDMIntroMessage(channel) { ); } -export function createOffTopicIntroMessage(channel) { +export function createOffTopicIntroMessage(channel, showInviteModal) { return ( <div className='channel-intro'> <h4 className='channel-intro__title'>{'Beginning of ' + channel.display_name}</h4> @@ -91,10 +91,9 @@ export function createOffTopicIntroMessage(channel) { <i className='fa fa-pencil'></i>{'Set a header'} </a> <a - className='intro-links' + role='menuitem' href='#' - data-toggle='modal' - data-target='#channel_invite' + onClick={showInviteModal} > <i className='fa fa-user-plus'></i>{'Invite others to this channel'} </a> @@ -155,7 +154,7 @@ export function createDefaultIntroMessage(channel) { ); } -export function createStandardIntroMessage(channel) { +export function createStandardIntroMessage(channel, showInviteModal) { var uiName = channel.display_name; var creatorName = ''; @@ -206,14 +205,12 @@ export function createStandardIntroMessage(channel) { <i className='fa fa-pencil'></i>{'Set a header'} </a> <a - className='intro-links' + role='menuitem' href='#' - data-toggle='modal' - data-target='#channel_invite' + onClick={showInviteModal} > <i className='fa fa-user-plus'></i>{'Invite others to this ' + uiType} </a> - </div> ); } |