// @flow import { observer, inject } from "mobx-react"; import { DocumentIcon, EmailIcon, ProfileIcon, PadlockIcon, CodeIcon, UserIcon, GroupIcon, LinkIcon, TeamIcon, ExpandedIcon, } from "outline-icons"; import * as React from "react"; import { withTranslation, type TFunction } from "react-i18next"; import type { RouterHistory } from "react-router-dom"; import styled from "styled-components"; import AuthStore from "stores/AuthStore"; import PoliciesStore from "stores/PoliciesStore"; import Flex from "components/Flex"; import Scrollable from "components/Scrollable"; import Sidebar from "./Sidebar"; import Header from "./components/Header"; import HeaderBlock from "./components/HeaderBlock"; import Section from "./components/Section"; import SidebarLink from "./components/SidebarLink"; import Version from "./components/Version"; import SlackIcon from "./icons/Slack"; import ZapierIcon from "./icons/Zapier"; import env from "env"; const isHosted = env.DEPLOYMENT === "hosted"; type Props = { history: RouterHistory, policies: PoliciesStore, auth: AuthStore, t: TFunction, }; @observer class SettingsSidebar extends React.Component { returnToDashboard = () => { this.props.history.push("/home"); }; render() { const { policies, t, auth } = this.props; const { team } = auth; if (!team) return null; const can = policies.abilities(team.id); return ( {t("Return to App")} } teamName={team.name} logoUrl={team.avatarUrl} onClick={this.returnToDashboard} />
Account
} label={t("Profile")} /> } label={t("Notifications")} /> } label={t("API Tokens")} />
Team
{can.update && ( } label={t("Details")} /> )} {can.update && ( } label={t("Security")} /> )} } exact={false} label={t("People")} /> } exact={false} label={t("Groups")} /> } label={t("Share Links")} /> {can.export && ( } label={t("Export Data")} /> )}
{can.update && (
{t("Integrations")}
} label="Slack" /> {isHosted && ( } label="Zapier" /> )}
)} {can.update && !isHosted && (
{t("Installation")}
)}
); } } const BackIcon = styled(ExpandedIcon)` transform: rotate(90deg); margin-left: -8px; `; const ReturnToApp = styled(Flex)` height: 16px; `; export default withTranslation()( inject("auth", "policies")(SettingsSidebar) );