From a6102e27d48d00fcc733c4d16754961903a239e0 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Sun, 31 Jan 2016 22:03:30 -0300 Subject: PLT-7: Refactoring frontend (chunk 8) - Sidebar and related components - Small Tweak to demotion and add msg for terminal cmd --- web/react/components/new_channel_modal.jsx | 118 ++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 19 deletions(-) (limited to 'web/react/components/new_channel_modal.jsx') diff --git a/web/react/components/new_channel_modal.jsx b/web/react/components/new_channel_modal.jsx index 9f733c476..788e6dc1b 100644 --- a/web/react/components/new_channel_modal.jsx +++ b/web/react/components/new_channel_modal.jsx @@ -2,9 +2,19 @@ // See License.txt for license information. import * as Utils from '../utils/utils.jsx'; + +import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl'; + var Modal = ReactBootstrap.Modal; -export default class NewChannelModal extends React.Component { +const holders = defineMessages({ + nameEx: { + id: 'channel_modal.nameEx', + defaultMessage: 'E.g.: "Bugs", "Marketing", "办公室恋情"' + } +}); + +class NewChannelModal extends React.Component { constructor(props) { super(props); @@ -32,7 +42,7 @@ export default class NewChannelModal extends React.Component { const displayName = ReactDOM.findDOMNode(this.refs.display_name).value.trim(); if (displayName.length < 1) { - this.setState({displayNameError: 'This field is required'}); + this.setState({displayNameError: true}); return; } @@ -51,7 +61,15 @@ export default class NewChannelModal extends React.Component { var displayNameClass = 'form-group'; if (this.state.displayNameError) { - displayNameError =

{this.state.displayNameError}

; + displayNameError = ( +

+ + {this.state.displayNameError} +

+ ); displayNameClass += ' has-error'; } @@ -63,29 +81,51 @@ export default class NewChannelModal extends React.Component { var channelSwitchText = ''; switch (this.props.channelType) { case 'P': - channelTerm = 'Group'; + channelTerm = ( + + ); channelSwitchText = (
- {'Create a new private group with restricted membership. '} + - {'Create a public channel'} +
); break; case 'O': - channelTerm = 'Channel'; + channelTerm = ( + + ); channelSwitchText = (
- {'Create a new public channel anyone can join. '} + - {'Create a private group'} +
); @@ -102,7 +142,13 @@ export default class NewChannelModal extends React.Component { onHide={this.props.onModalDismissed} > - {'New ' + channelTerm} + + + {channelTerm} +
- +
- {'Edit'} + {')'}

@@ -141,22 +195,38 @@ export default class NewChannelModal extends React.Component {
- - + +