Cleaned up how channel intro messages display set channel header button

Этот коммит содержится в:
hmhealey
2015-11-17 09:17:00 -05:00
родитель 6c3a1d7039
Коммит e8f6dd2f33

Просмотреть файл

@@ -3,6 +3,7 @@
import * as Utils from './utils.jsx'; import * as Utils from './utils.jsx';
import EditChannelHeaderModal from '../components/edit_channel_header_modal.jsx'; import EditChannelHeaderModal from '../components/edit_channel_header_modal.jsx';
import GetTeamInviteLinkModal from '../components/get_team_invite_link_modal.jsx';
import InviteMemberModal from '../components/invite_member_modal.jsx'; import InviteMemberModal from '../components/invite_member_modal.jsx';
import ToggleModalButton from '../components/toggle_modal_button.jsx'; import ToggleModalButton from '../components/toggle_modal_button.jsx';
import UserProfile from '../components/user_profile.jsx'; import UserProfile from '../components/user_profile.jsx';
@@ -50,13 +51,7 @@ export function createDMIntroMessage(channel) {
{'This is the start of your direct message history with ' + teammateName + '.'}<br/> {'This is the start of your direct message history with ' + teammateName + '.'}<br/>
{'Direct messages and files shared here are not shown to people outside this area.'} {'Direct messages and files shared here are not shown to people outside this area.'}
</p> </p>
<ToggleModalButton {createSetHeaderButton(channel)}
className='intro-links'
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
<i className='fa fa-pencil'></i>{'Set a header'}
</ToggleModalButton>
</div> </div>
); );
} }
@@ -76,13 +71,7 @@ export function createOffTopicIntroMessage(channel, showInviteModal) {
{'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'} {'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'}
<br/> <br/>
</p> </p>
<ToggleModalButton {createSetHeaderButton(channel)}
className='intro-links'
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
<i className='fa fa-pencil'></i>{'Set a header'}
</ToggleModalButton>
<a <a
href='#' href='#'
className='intro-links' className='intro-links'
@@ -131,13 +120,7 @@ export function createDefaultIntroMessage(channel) {
{'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'} {'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'}
</p> </p>
{inviteModalLink} {inviteModalLink}
<ToggleModalButton {createSetHeaderButton(channel)}
className='intro-links'
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
<i className='fa fa-pencil'></i>{'Set a header'}
</ToggleModalButton>
<br/> <br/>
</div> </div>
); );
@@ -182,13 +165,7 @@ export function createStandardIntroMessage(channel, showInviteModal) {
{memberMessage} {memberMessage}
<br/> <br/>
</p> </p>
<ToggleModalButton {createSetHeaderButton(channel)}
className='intro-links'
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
<i className='fa fa-pencil'></i>{'Set a header'}
</ToggleModalButton>
<a <a
className='intro-links' className='intro-links'
href='#' href='#'
@@ -199,3 +176,15 @@ export function createStandardIntroMessage(channel, showInviteModal) {
</div> </div>
); );
} }
function createSetHeaderButton(channel) {
return (
<ToggleModalButton
className='intro-links'
dialogType={EditChannelHeaderModal}
dialogProps={{channel}}
>
<i className='fa fa-pencil'></i>{'Set a header'}
</ToggleModalButton>
);
}