import { observer } from "mobx-react"; import { NewDocumentIcon, EmailIcon, ProfileIcon, PadlockIcon, CodeIcon, UserIcon, GroupIcon, LinkIcon, TeamIcon, BackIcon, BeakerIcon, DownloadIcon, } from "outline-icons"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; import styled from "styled-components"; import Flex from "~/components/Flex"; import Scrollable from "~/components/Scrollable"; import SlackIcon from "~/components/SlackIcon"; import ZapierIcon from "~/components/ZapierIcon"; import env from "~/env"; import useCurrentTeam from "~/hooks/useCurrentTeam"; import usePolicy from "~/hooks/usePolicy"; import Sidebar from "./Sidebar"; import Header from "./components/Header"; import Section from "./components/Section"; import SidebarButton from "./components/SidebarButton"; import SidebarLink from "./components/SidebarLink"; import Version from "./components/Version"; const isHosted = env.DEPLOYMENT === "hosted"; function SettingsSidebar() { const { t } = useTranslation(); const history = useHistory(); const team = useCurrentTeam(); const can = usePolicy(team.id); const returnToApp = React.useCallback(() => { history.push("/home"); }, [history]); return ( } onClick={returnToApp} minHeight={48} />
{t("Account")}
} label={t("Profile")} /> } label={t("Notifications")} /> {can.createApiKey && ( } label={t("API Tokens")} /> )}
{t("Team")}
{can.update && ( } label={t("Details")} /> )} {can.update && ( } label={t("Security")} /> )} {can.update && ( } label={t("Features")} /> )} } exact={false} label={t("Members")} /> } exact={false} label={t("Groups")} /> } label={t("Share Links")} /> {can.manage && ( } label={t("Import")} /> )} {can.export && ( } label={t("Export")} /> )}
{can.update && (env.SLACK_KEY || isHosted) && (
{t("Integrations")}
{env.SLACK_KEY && ( } label="Slack" /> )} {isHosted && ( } label="Zapier" /> )}
)} {can.update && !isHosted && (
{t("Installation")}
)}
); } const StyledBackIcon = styled(BackIcon)` margin-left: 4px; `; export default observer(SettingsSidebar);