2017-11-27 02:09:55 +00:00
|
|
|
// @flow
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { observer, inject } from 'mobx-react';
|
2018-05-03 04:51:39 +00:00
|
|
|
import { ProfileIcon, SettingsIcon, CodeIcon, UserIcon } 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-02-11 07:24:12 +00:00
|
|
|
class SettingsSidebar extends Component {
|
2017-11-27 02:09:55 +00:00
|
|
|
props: Props;
|
|
|
|
|
|
|
|
returnToDashboard = () => {
|
|
|
|
this.props.history.push('/');
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { team } = this.props.auth;
|
|
|
|
if (!team) return;
|
|
|
|
|
|
|
|
return (
|
2018-02-11 07:24:12 +00:00
|
|
|
<Sidebar>
|
2017-11-27 02:09:55 +00:00
|
|
|
<HeaderBlock
|
|
|
|
subheading="◄ Return to Dashboard"
|
|
|
|
teamName={team.name}
|
|
|
|
logoUrl={team.avatarUrl}
|
|
|
|
onClick={this.returnToDashboard}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Flex auto column>
|
|
|
|
<Scrollable>
|
|
|
|
<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-03-05 06:34:06 +00:00
|
|
|
<SidebarLink to="/settings/users" icon={<UserIcon />}>
|
|
|
|
Users
|
2018-01-18 04:49:43 +00:00
|
|
|
</SidebarLink>
|
2017-11-27 02:09:55 +00:00
|
|
|
<SidebarLink
|
|
|
|
to="/settings/integrations/slack"
|
|
|
|
icon={<SettingsIcon />}
|
|
|
|
>
|
|
|
|
Integrations
|
|
|
|
</SidebarLink>
|
|
|
|
</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);
|