summaryrefslogtreecommitdiffstats
path: root/web/react/components/channel_info_modal.jsx
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-02-02 19:39:56 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-02-02 19:39:56 -0300
commitd424c9eaf12653332f15afa2cb9dfc6684fa95d8 (patch)
treecbec268ebd8df0f5ddeb1e9d7e177bcfc1644b65 /web/react/components/channel_info_modal.jsx
parent320fe1c39240644ce15fa2a436ac4a5591b95083 (diff)
downloadchat-d424c9eaf12653332f15afa2cb9dfc6684fa95d8.tar.gz
chat-d424c9eaf12653332f15afa2cb9dfc6684fa95d8.tar.bz2
chat-d424c9eaf12653332f15afa2cb9dfc6684fa95d8.zip
PLT-7: Refactoring frontend (chunk 10)
- Modals - Fix bug on msg_typing - Add missing translations in es.json for EE
Diffstat (limited to 'web/react/components/channel_info_modal.jsx')
-rw-r--r--web/react/components/channel_info_modal.jsx57
1 files changed, 47 insertions, 10 deletions
diff --git a/web/react/components/channel_info_modal.jsx b/web/react/components/channel_info_modal.jsx
index 72c7c3daa..5067f5913 100644
--- a/web/react/components/channel_info_modal.jsx
+++ b/web/react/components/channel_info_modal.jsx
@@ -2,17 +2,28 @@
// See License.txt for license information.
import * as Utils from '../utils/utils.jsx';
+
+import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'mm-intl';
+
const Modal = ReactBootstrap.Modal;
-export default class ChannelInfoModal extends React.Component {
+const holders = defineMessages({
+ notFound: {
+ id: 'channel_info.notFound',
+ defaultMessage: 'No Channel Found'
+ }
+});
+
+class ChannelInfoModal extends React.Component {
render() {
+ const {formatMessage} = this.props.intl;
let channel = this.props.channel;
if (!channel) {
channel = {
- display_name: 'No Channel Found',
- name: 'No Channel Found',
- purpose: 'No Channel Found',
- id: 'No Channel Found'
+ display_name: formatMessage(holders.notFound),
+ name: formatMessage(holders.notFound),
+ purpose: formatMessage(holders.notFound),
+ id: formatMessage(holders.notFound)
};
}
@@ -28,19 +39,39 @@ export default class ChannelInfoModal extends React.Component {
</Modal.Header>
<Modal.Body ref='modalBody'>
<div className='row form-group'>
- <div className='col-sm-3 info__label'>{'Channel Name:'}</div>
+ <div className='col-sm-3 info__label'>
+ <FormattedMessage
+ id='channel_info.name'
+ defaultMessage='Channel Name:'
+ />
+ </div>
<div className='col-sm-9'>{channel.display_name}</div>
</div>
<div className='row form-group'>
- <div className='col-sm-3 info__label'>{'Channel URL:'}</div>
+ <div className='col-sm-3 info__label'>
+ <FormattedMessage
+ id='channel_info.url'
+ defaultMessage='Channel URL:'
+ />
+ </div>
<div className='col-sm-9'>{channelURL}</div>
</div>
<div className='row'>
- <div className='col-sm-3 info__label'>{'Channel ID:'}</div>
+ <div className='col-sm-3 info__label'>
+ <FormattedMessage
+ id='channel_info.id'
+ defaultMessage='Channel ID:'
+ />
+ </div>
<div className='col-sm-9'>{channel.id}</div>
</div>
<div className='row'>
- <div className='col-sm-3 info__label'>{'Channel Purpose:'}</div>
+ <div className='col-sm-3 info__label'>
+ <FormattedMessage
+ id='channel_info.purpose'
+ defaultMessage='Channel Purpose:'
+ />
+ </div>
<div className='col-sm-9'>{channel.purpose}</div>
</div>
</Modal.Body>
@@ -50,7 +81,10 @@ export default class ChannelInfoModal extends React.Component {
className='btn btn-default'
onClick={this.props.onHide}
>
- {'Close'}
+ <FormattedMessage
+ id='channel_info.close'
+ defaultMessage='Close'
+ />
</button>
</Modal.Footer>
</Modal>
@@ -59,7 +93,10 @@ export default class ChannelInfoModal extends React.Component {
}
ChannelInfoModal.propTypes = {
+ intl: intlShape.isRequired,
show: React.PropTypes.bool.isRequired,
onHide: React.PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired
};
+
+export default injectIntl(ChannelInfoModal); \ No newline at end of file