// @flow import { observer } from "mobx-react"; import { DocumentIcon, EmailIcon, ProfileIcon, PadlockIcon, CodeIcon, UserIcon, GroupIcon, LinkIcon, TeamIcon, ExpandedIcon, } 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 Sidebar from "./Sidebar"; import Header from "./components/Header"; import Section from "./components/Section"; import SidebarLink from "./components/SidebarLink"; import TeamButton from "./components/TeamButton"; import Version from "./components/Version"; import env from "env"; import useCurrentTeam from "hooks/useCurrentTeam"; import useStores from "hooks/useStores"; const isHosted = env.DEPLOYMENT === "hosted"; function SettingsSidebar() { const { t } = useTranslation(); const history = useHistory(); const team = useCurrentTeam(); const { policies } = useStores(); const can = policies.abilities(team.id); const returnToDashboard = React.useCallback(() => { history.push("/home"); }, [history]); return ( {t("Return to App")} } teamName={team.name} logoUrl={team.avatarUrl} onClick={returnToDashboard} />
{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")} /> )} } exact={false} label={t("Members")} /> } exact={false} label={t("Groups")} /> } label={t("Share Links")} /> {can.export && ( } label={`${t("Import")} / ${t("Export")}`} /> )}
{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 observer(SettingsSidebar);