summaryrefslogtreecommitdiffstats
path: root/webapp/components/get_team_invite_link_modal.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-29 08:40:06 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-29 08:40:06 -0400
commit1f4974dc02c786b65c802d4497fd736cca79d01c (patch)
tree1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/get_team_invite_link_modal.jsx
parent9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff)
downloadchat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.gz
chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.bz2
chat-1f4974dc02c786b65c802d4497fd736cca79d01c.zip
General react performance improvements (#2796)
* General React performance improvements * Cleaned up unused props/state in PermaLinkView and PostFocusView
Diffstat (limited to 'webapp/components/get_team_invite_link_modal.jsx')
-rw-r--r--webapp/components/get_team_invite_link_modal.jsx41
1 files changed, 11 insertions, 30 deletions
diff --git a/webapp/components/get_team_invite_link_modal.jsx b/webapp/components/get_team_invite_link_modal.jsx
index 33cc065d1..109cb2120 100644
--- a/webapp/components/get_team_invite_link_modal.jsx
+++ b/webapp/components/get_team_invite_link_modal.jsx
@@ -1,36 +1,24 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import Constants from 'utils/constants.jsx';
import GetLinkModal from './get_link_modal.jsx';
import ModalStore from 'stores/modal_store.jsx';
import TeamStore from 'stores/team_store.jsx';
-import {intlShape, injectIntl, defineMessages} from 'react-intl';
-
-const holders = defineMessages({
- title: {
- id: 'get_team_invite_link_modal.title',
- defaultMessage: 'Team Invite Link'
- },
- help: {
- id: 'get_team_invite_link_modal.help',
- defaultMessage: 'Send teammates the link below for them to sign-up to this team site. The Team Invite Link can be shared with multiple teammates as it does not change unless it\'s regenerated in Team Settings by a Team Admin.'
- },
- helpDisabled: {
- id: 'get_team_invite_link_modal.helpDisabled',
- defaultMessage: 'User creation has been disabled for your team. Please ask your team administrator for details.'
- }
-});
+import * as Utils from 'utils/utils.jsx';
+import Constants from 'utils/constants.jsx';
import React from 'react';
+import PureRenderMixin from 'react-addons-pure-render-mixin';
-class GetTeamInviteLinkModal extends React.Component {
+export default class GetTeamInviteLinkModal extends React.Component {
constructor(props) {
super(props);
this.handleToggle = this.handleToggle.bind(this);
+ this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
+
this.state = {
show: false
};
@@ -51,28 +39,21 @@ class GetTeamInviteLinkModal extends React.Component {
}
render() {
- const {formatMessage} = this.props.intl;
-
- let helpText = formatMessage(holders.helpDisabled);
-
+ let helpText;
if (global.window.mm_config.EnableUserCreation === 'true') {
- helpText = formatMessage(holders.help);
+ helpText = Utils.localizeMessage('get_team_invite_link_modal.help', 'Send teammates the link below for them to sign-up to this team site. The Team Invite Link can be shared with multiple teammates as it does not change unless it\'s regenerated in Team Settings by a Team Admin.');
+ } else {
+ helpText = Utils.localizeMessage('get_team_invite_link_modal.helpDisabled', 'User creation has been disabled for your team. Please ask your team administrator for details.');
}
return (
<GetLinkModal
show={this.state.show}
onHide={() => this.setState({show: false})}
- title={formatMessage(holders.title)}
+ title={Utils.localizeMessage('get_team_invite_link_modal.title', 'Team Invite Link')}
helpText={helpText}
link={TeamStore.getCurrentInviteLink()}
/>
);
}
}
-
-GetTeamInviteLinkModal.propTypes = {
- intl: intlShape.isRequired
-};
-
-export default injectIntl(GetTeamInviteLinkModal);