From 12896bd23eeba79884245c1c29fdc568cf21a7fa Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 14 Mar 2016 08:50:46 -0400 Subject: Converting to Webpack. Stage 1. --- webapp/components/team_settings_modal.jsx | 127 ++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 webapp/components/team_settings_modal.jsx (limited to 'webapp/components/team_settings_modal.jsx') diff --git a/webapp/components/team_settings_modal.jsx b/webapp/components/team_settings_modal.jsx new file mode 100644 index 000000000..7dbbd680a --- /dev/null +++ b/webapp/components/team_settings_modal.jsx @@ -0,0 +1,127 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import $ from 'jquery'; +import ReactDOM from 'react-dom'; +import SettingsSidebar from './settings_sidebar.jsx'; +import TeamSettings from './team_settings.jsx'; + +import {intlShape, injectIntl, defineMessages, FormattedMessage} from 'react-intl'; + +const holders = defineMessages({ + generalTab: { + id: 'team_settings_modal.generalTab', + defaultMessage: 'General' + }, + importTab: { + id: 'team_settings_modal.importTab', + defaultMessage: 'Import' + }, + exportTab: { + id: 'team_settings_modal.exportTab', + defaultMessage: 'Export' + } +}); + +import React from 'react'; + +class TeamSettingsModal extends React.Component { + constructor(props) { + super(props); + + this.updateTab = this.updateTab.bind(this); + this.updateSection = this.updateSection.bind(this); + + this.state = { + activeTab: 'general', + activeSection: '' + }; + } + componentDidMount() { + const modal = $(ReactDOM.findDOMNode(this.refs.modal)); + + modal.on('click', '.modal-back', function handleBackClick() { + $(this).closest('.modal-dialog').removeClass('display--content'); + $(this).closest('.modal-dialog').find('.settings-table .nav li.active').removeClass('active'); + }); + modal.on('click', '.modal-header .close', () => { + setTimeout(() => { + $('.modal-dialog.display--content').removeClass('display--content'); + }, 500); + }); + } + updateTab(tab) { + this.setState({activeTab: tab, activeSection: ''}); + } + updateSection(section) { + this.setState({activeSection: section}); + } + render() { + const {formatMessage} = this.props.intl; + const tabs = []; + tabs.push({name: 'general', uiName: formatMessage(holders.generalTab), icon: 'glyphicon glyphicon-cog'}); + tabs.push({name: 'import', uiName: formatMessage(holders.importTab), icon: 'glyphicon glyphicon-upload'}); + + // To enable export uncomment this line + //tabs.push({name: 'export', uiName: formatMessage(holders.exportTab), icon: 'glyphicon glyphicon-download'}); + + return ( + + ); + } +} + +TeamSettingsModal.propTypes = { + intl: intlShape.isRequired +}; + +export default injectIntl(TeamSettingsModal); \ No newline at end of file -- cgit v1.2.3-1-g7c22