2017-11-27 02:09:55 +00:00
|
|
|
// @flow
|
2018-05-05 23:16:08 +00:00
|
|
|
import * as React from 'react';
|
2017-11-27 02:09:55 +00:00
|
|
|
import { observer, inject } from 'mobx-react';
|
2018-05-23 06:01:49 +00:00
|
|
|
import {
|
2018-06-21 04:33:21 +00:00
|
|
|
DocumentIcon,
|
2018-05-23 06:01:49 +00:00
|
|
|
ProfileIcon,
|
|
|
|
SettingsIcon,
|
|
|
|
CodeIcon,
|
|
|
|
UserIcon,
|
|
|
|
LinkIcon,
|
2018-06-01 22:00:48 +00:00
|
|
|
TeamIcon,
|
2018-05-23 06:01:49 +00:00
|
|
|
} from 'outline-icons';
|
2017-11-27 02:09:55 +00:00
|
|
|
|
2018-05-03 04:51:39 +00:00
|
|
|
import Flex from 'shared/components/Flex';
|
2018-02-11 07:24:12 +00:00
|
|
|
import Sidebar, { Section } from './Sidebar';
|
2017-11-27 02:09:55 +00:00
|
|
|
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> {
|
2017-11-27 02:09:55 +00:00
|
|
|
returnToDashboard = () => {
|
|
|
|
this.props.history.push('/');
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2018-05-31 19:52:03 +00:00
|
|
|
const { team, user } = this.props.auth;
|
|
|
|
if (!team || !user) return;
|
2017-11-27 02:09:55 +00:00
|
|
|
|
|
|
|
return (
|
2018-02-11 07:24:12 +00:00
|
|
|
<Sidebar>
|
2017-11-27 02:09:55 +00:00
|
|
|
<HeaderBlock
|
2018-05-21 03:21:39 +00:00
|
|
|
subheading="◄ Return to App"
|
2017-11-27 02:09:55 +00:00
|
|
|
teamName={team.name}
|
|
|
|
logoUrl={team.avatarUrl}
|
|
|
|
onClick={this.returnToDashboard}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Flex auto column>
|
2018-05-06 19:46:52 +00:00
|
|
|
<Scrollable shadow>
|
2017-11-27 02:09:55 +00:00
|
|
|
<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>
|
2018-05-31 19:52:03 +00:00
|
|
|
{user.isAdmin && (
|
2018-06-01 22:00:48 +00:00
|
|
|
<SidebarLink to="/settings/details" icon={<TeamIcon />}>
|
2018-05-31 19:52:03 +00:00
|
|
|
Details
|
|
|
|
</SidebarLink>
|
|
|
|
)}
|
2018-05-31 21:49:19 +00:00
|
|
|
<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>
|
2018-05-31 19:52:03 +00:00
|
|
|
{user.isAdmin && (
|
|
|
|
<SidebarLink
|
|
|
|
to="/settings/integrations/slack"
|
|
|
|
icon={<SettingsIcon />}
|
|
|
|
>
|
|
|
|
Integrations
|
|
|
|
</SidebarLink>
|
|
|
|
)}
|
2018-06-21 04:33:21 +00:00
|
|
|
{user.isAdmin && (
|
|
|
|
<SidebarLink to="/settings/export" icon={<DocumentIcon />}>
|
|
|
|
Export Data
|
|
|
|
</SidebarLink>
|
|
|
|
)}
|
2017-11-27 02:09:55 +00:00
|
|
|
</Section>
|
|
|
|
</Scrollable>
|
|
|
|
</Flex>
|
2018-02-11 07:24:12 +00:00
|
|
|
</Sidebar>
|
2017-11-27 02:09:55 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-11 07:24:12 +00:00
|
|
|
export default inject('auth')(SettingsSidebar);
|