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