// @flow import React, { Component } from 'react'; import { withRouter } from 'react-router-dom'; import type { Location } from 'react-router-dom'; import styled from 'styled-components'; import { observer, inject } from 'mobx-react'; import Flex from 'shared/components/Flex'; import { color, layout } from 'shared/styles/constants'; import Scrollable from 'components/Scrollable'; import ProfileIcon from 'components/Icon/ProfileIcon'; import SettingsIcon from 'components/Icon/SettingsIcon'; import CodeIcon from 'components/Icon/CodeIcon'; import Header from './components/Header'; import SidebarLink from './components/SidebarLink'; import HeaderBlock from './components/HeaderBlock'; import AuthStore from 'stores/AuthStore'; type Props = { history: Object, location: Location, auth: AuthStore, }; @observer class Sidebar extends Component { props: Props; returnToDashboard = () => { this.props.history.push('/'); }; render() { const { team } = this.props.auth; if (!team) return; return (
Account
}> Profile }> API Tokens
Team
}> Members } > Integrations
); } } const Container = styled(Flex)` position: fixed; top: 0; bottom: 0; left: 0; width: ${layout.sidebarWidth}; background: ${color.smoke}; transition: left 200ms ease-in-out; `; const Section = styled(Flex)` flex-direction: column; margin: 24px 0; padding: 0 24px; position: relative; `; export default withRouter(inject('auth')(Sidebar));