| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- import React from 'react';
- // import PropTypes from 'prop-types';
- import { withTranslation } from 'react-i18next';
- import BacklogIcon from '@atlaskit/icon/glyph/backlog';
- import BoardIcon from '@atlaskit/icon/glyph/board';
- import GraphLineIcon from '@atlaskit/icon/glyph/graph-line';
- import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
- import { JiraWordmark } from '@atlaskit/logo';
- import {
- GroupHeading,
- HeaderSection,
- Item,
- LayoutManager,
- MenuSection,
- NavigationProvider,
- Separator,
- Wordmark,
- ThemeProvider, modeGenerator,
- } from '@atlaskit/navigation-next';
- import { createSubscribedElement } from './UnstatedUtils';
- import AppContainer from '../services/AppContainer';
- import SidebarNav from './Sidebar/SidebarNav';
- class Sidebar extends React.Component {
- static propTypes = {
- };
- state = {
- };
- renderSidebarContents = () => (
- <>
- <HeaderSection>
- { () => (
- <div className="grw-product-nav-header">
- <Wordmark wordmark={JiraWordmark} />
- </div>
- ) }
- </HeaderSection>
- <MenuSection>
- { () => (
- <div className="grw-product-nav-menu">
- <Item
- before={BacklogIcon}
- text="Backlog"
- isSelected
- />
- <Item
- before={BoardIcon}
- text="Active sprints"
- />
- <Item
- before={GraphLineIcon}
- text="Reports"
- />
- <Separator />
- <GroupHeading>Shortcuts</GroupHeading>
- <Item before={ShortcutIcon} text="Project space" />
- <Item before={ShortcutIcon} text="Looooooooooooooooooooooooooooooong Menu" />
- </div>
- ) }
- </MenuSection>
- </>
- );
- render() {
- return (
- <ThemeProvider
- theme={theme => ({
- ...theme,
- context: 'product',
- mode: modeGenerator({
- product: { text: '#ffffff', background: '#334455' },
- }),
- })}
- >
- <NavigationProvider>
- <LayoutManager
- globalNavigation={SidebarNav}
- productNavigation={() => null}
- containerNavigation={this.renderSidebarContents}
- experimental_flyoutOnHover
- experimental_alternateFlyoutBehaviour
- // experimental_fullWidthFlyout
- shouldHideGlobalNavShadow
- showContextualNavigation
- >
- </LayoutManager>
- </NavigationProvider>
- </ThemeProvider>
- );
- }
- }
- /**
- * Wrapper component for using unstated
- */
- const SidebarWrapper = (props) => {
- return createSubscribedElement(Sidebar, props, [AppContainer]);
- };
- export default withTranslation()(SidebarWrapper);
|