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

71 lines
1.8 KiB
JavaScript
Raw Normal View History

// @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';
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
class SettingsSidebar extends Component {
props: Props;
returnToDashboard = () => {
this.props.history.push('/');
};
render() {
const { team } = this.props.auth;
if (!team) return;
return (
<Sidebar>
<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>
<SidebarLink
to="/settings/integrations/slack"
icon={<SettingsIcon />}
>
Integrations
</SidebarLink>
</Section>
</Scrollable>
</Flex>
</Sidebar>
);
}
}
export default inject('auth')(SettingsSidebar);