From 6a3806fe9d03abdfa1eb30fc62c7388a6922b60f Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 3 Feb 2016 00:46:56 -0300 Subject: PLT-7: Refactoring frontend (chunk 11) - channel view - Added translations for previous commits - Fix bug on signup_team email body --- web/react/utils/channel_intro_messages.jsx | 146 +++++++++++++++++++++++------ 1 file changed, 115 insertions(+), 31 deletions(-) (limited to 'web/react/utils/channel_intro_messages.jsx') diff --git a/web/react/utils/channel_intro_messages.jsx b/web/react/utils/channel_intro_messages.jsx index 9685f94b0..69e08f143 100644 --- a/web/react/utils/channel_intro_messages.jsx +++ b/web/react/utils/channel_intro_messages.jsx @@ -11,6 +11,8 @@ import Constants from '../utils/constants.jsx'; import TeamStore from '../stores/team_store.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; +import {FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'mm-intl'; + export function createChannelIntroMessage(channel) { if (channel.type === 'D') { return createDMIntroMessage(channel); @@ -48,8 +50,13 @@ export function createDMIntroMessage(channel) {

- {'This is the start of your direct message history with ' + teammateName + '.'}
- {'Direct messages and files shared here are not shown to people outside this area.'} +

{createSetHeaderButton(channel)} @@ -58,7 +65,12 @@ export function createDMIntroMessage(channel) { return (
-

{'This is the start of your direct message history with this teammate. Direct messages and files shared here are not shown to people outside this area.'}

+

+ +

); } @@ -66,11 +78,13 @@ export function createDMIntroMessage(channel) { export function createOffTopicIntroMessage(channel) { return (
-

{'Beginning of ' + channel.display_name}

-

- {'This is the start of ' + channel.display_name + ', a channel for non-work-related conversations.'} -
-

+ {createSetHeaderButton(channel)} {createInviteChannelMemberButton(channel, 'channel')}
@@ -87,7 +101,11 @@ export function createDefaultIntroMessage(channel) { href='#' onClick={EventHelpers.showInviteMemberModal} > - {'Invite others to this team'} + + ); } else { @@ -97,19 +115,24 @@ export function createDefaultIntroMessage(channel) { href='#' onClick={EventHelpers.showGetTeamInviteLinkModal} > - {'Invite others to this team'} + + ); } return (
-

{'Beginning of ' + channel.display_name}

-

- {'Welcome to ' + channel.display_name + '!'} -

- {'This is the first channel teammates see when they sign up - use it for posting updates everyone needs to know.'} -

+ {inviteModalLink} {createSetHeaderButton(channel)}
@@ -124,33 +147,83 @@ export function createStandardIntroMessage(channel) { var uiType; var memberMessage; if (channel.type === 'P') { - uiType = 'private group'; - memberMessage = ' Only invited members can see this private group.'; + uiType = ( + + ); + memberMessage = ( + + ); } else { - uiType = 'channel'; - memberMessage = ' Any member can join and read this channel.'; + uiType = ( + + ); + memberMessage = ( + + ); } + const date = ( + + ); + var createMessage; if (creatorName === '') { - createMessage = 'This is the start of the ' + uiName + ' ' + uiType + ', created on ' + Utils.displayDate(channel.create_at) + '.'; + createMessage = ( + + ); } else { createMessage = ( - {'This is the start of the '} - {uiName} - {' '} - {uiType}{', created by '} - {creatorName} - {' on '} - {Utils.displayDate(channel.create_at)} + ); } return (
-

{'Beginning of ' + uiName}

+

+ +

{createMessage} {memberMessage} @@ -169,7 +242,14 @@ function createInviteChannelMemberButton(channel, uiType) { dialogType={ChannelInviteModal} dialogProps={{channel}} > - {'Invite others to this ' + uiType} + + ); } @@ -181,7 +261,11 @@ function createSetHeaderButton(channel) { dialogType={EditChannelHeaderModal} dialogProps={{channel}} > - {'Set a header'} + + ); } -- cgit v1.2.3-1-g7c22