This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/app/components/Sidebar/Settings.js

85 lines
2.2 KiB
JavaScript
Raw Normal View History

// @flow
2018-05-05 23:16:08 +00:00
import * as React from 'react';
import { observer, inject } from 'mobx-react';
2018-05-23 06:01:49 +00:00
import {
ProfileIcon,
SettingsIcon,
CodeIcon,
UserIcon,
LinkIcon,
} from 'outline-icons';
2018-05-03 04:51:39 +00:00
import Flex from 'shared/components/Flex';
import Sidebar, { Section } from './Sidebar';
import Scrollable from 'components/Scrollable';
import Header from './components/Header';
import SidebarLink from './components/SidebarLink';
import HeaderBlock from './components/HeaderBlock';
import AuthStore from 'stores/AuthStore';
type Props = {
history: Object,
auth: AuthStore,
};
@observer
2018-05-05 23:16:08 +00:00
class SettingsSidebar extends React.Component<Props> {
returnToDashboard = () => {
this.props.history.push('/');
};
render() {
const { team, user } = this.props.auth;
if (!team || !user) return;
return (
<Sidebar>
<HeaderBlock
subheading="◄ Return to App"
teamName={team.name}
logoUrl={team.avatarUrl}
onClick={this.returnToDashboard}
/>
<Flex auto column>
2018-05-06 19:46:52 +00:00
<Scrollable shadow>
<Section>
<Header>Account</Header>
<SidebarLink to="/settings" icon={<ProfileIcon />}>
Profile
</SidebarLink>
<SidebarLink to="/settings/tokens" icon={<CodeIcon />}>
API Tokens
</SidebarLink>
</Section>
<Section>
<Header>Team</Header>
{user.isAdmin && (
<SidebarLink to="/settings/details" icon={<SettingsIcon />}>
Details
</SidebarLink>
)}
<SidebarLink to="/settings/people" icon={<UserIcon />}>
People
2018-01-18 04:49:43 +00:00
</SidebarLink>
2018-05-23 06:01:49 +00:00
<SidebarLink to="/settings/shares" icon={<LinkIcon />}>
Share Links
</SidebarLink>
{user.isAdmin && (
<SidebarLink
to="/settings/integrations/slack"
icon={<SettingsIcon />}
>
Integrations
</SidebarLink>
)}
</Section>
</Scrollable>
</Flex>
</Sidebar>
);
}
}
export default inject('auth')(SettingsSidebar);