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/sidebar_right_menu.jsx | 218 +++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 webapp/components/sidebar_right_menu.jsx (limited to 'webapp/components/sidebar_right_menu.jsx') diff --git a/webapp/components/sidebar_right_menu.jsx b/webapp/components/sidebar_right_menu.jsx new file mode 100644 index 000000000..05e2054ea --- /dev/null +++ b/webapp/components/sidebar_right_menu.jsx @@ -0,0 +1,218 @@ +// 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 GlobalActions from 'action_creators/global_actions.jsx'; +import * as Utils from 'utils/utils.jsx'; + +import {FormattedMessage} from 'react-intl'; +import {Link} from 'react-router'; + +import React from 'react'; + +export default class SidebarRightMenu extends React.Component { + constructor(props) { + super(props); + + this.state = { + showUserSettingsModal: false + }; + } + + 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 = ( +
  • + + + + +
  • + ); + + if (this.props.teamType === 'O') { + teamLink = ( +
  • + + + + +
  • + ); + } + } + + if (isAdmin) { + teamSettingsLink = ( +
  • + + + + +
  • + ); + manageLink = ( +
  • + + + + +
  • + ); + } + + if (isSystemAdmin && !Utils.isMobile()) { + consoleLink = ( +
  • + + + + +
  • + ); + } + + 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 = ( +
  • + + + + +
  • + ); + } + + let reportLink = null; + if (global.window.mm_config.ReportAProblemLink) { + reportLink = ( +
  • + + + + +
  • + ); + } + return ( + + ); + } +} + +SidebarRightMenu.propTypes = { + teamType: React.PropTypes.string, + teamDisplayName: React.PropTypes.string +}; -- cgit v1.2.3-1-g7c22