// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import TeamMembersModal from './team_members_modal.jsx'; import ToggleModalButton from './toggle_modal_button.jsx'; import UserSettingsModal from './user_settings/user_settings_modal.jsx'; import UserStore from '../stores/user_store.jsx'; import * as client from '../utils/client.jsx'; import * as EventHelpers from '../dispatcher/event_helpers.jsx'; import * as utils from '../utils/utils.jsx'; export default class SidebarRightMenu extends React.Component { componentDidMount() { $('.sidebar--left .dropdown-menu').perfectScrollbar(); } constructor(props) { super(props); this.handleLogoutClick = this.handleLogoutClick.bind(this); this.state = { showUserSettingsModal: false }; } handleLogoutClick(e) { e.preventDefault(); client.logout(); } render() { var teamLink = ''; var inviteLink = ''; var teamSettingsLink = ''; var manageLink = ''; var consoleLink = ''; var currentUser = UserStore.getCurrentUser(); var isAdmin = false; var isSystemAdmin = false; if (currentUser != null) { isAdmin = utils.isAdmin(currentUser.roles); isSystemAdmin = utils.isSystemAdmin(currentUser.roles); inviteLink = (
  • {'Invite New Member'}
  • ); if (this.props.teamType === 'O') { teamLink = (
  • {'Get Team Invite Link'}
  • ); } } if (isAdmin) { teamSettingsLink = (
  • {'Team Settings'}
  • ); manageLink = (
  • {'Manage Members'}
  • ); } if (isSystemAdmin && !utils.isMobile()) { consoleLink = (
  • {'System Console'}
  • ); } var siteName = ''; if (global.window.mm_config.SiteName != null) { siteName = global.window.mm_config.SiteName; } var teamDisplayName = siteName; if (this.props.teamDisplayName) { teamDisplayName = this.props.teamDisplayName; } let helpLink = null; if (global.window.mm_config.HelpLink) { helpLink = (
  • {'Help'}
  • ); } let reportLink = null; if (global.window.mm_config.ReportAProblemLink) { reportLink = (
  • {'Report a Problem'}
  • ); } return (
    {teamDisplayName}
    this.setState({showUserSettingsModal: false})} />
    ); } } SidebarRightMenu.propTypes = { teamType: React.PropTypes.string, teamDisplayName: React.PropTypes.string };