import * as React from 'react'; import DocumentsIcon from '@atlaskit/icon/glyph/documents'; import SearchIcon from '@atlaskit/icon/glyph/search'; import { GlobalNav, LayoutManager, NavigationProvider, } from '@atlaskit/navigation-next'; import LinkComponent from './navigation/link-component'; import SearchDrawer from './navigation/search-drawer'; export type Props = { // TODO TSFix: Type this navContent: any; }; type State = { showSearchDrawer: boolean; }; class NavigationWrapper extends React.Component { state = { showSearchDrawer: false, }; render() { const { children, navContent } = this.props; const { showSearchDrawer } = this.state; // ToDo Cache is disabled for now to avoid the nav resize issue during SSR. return ( ( ( ), id: 'logo', tooltip: 'Frontend docs home', href: '/', component: LinkComponent, }, { // TODO this throws a scary large error in the console as the SSR doesn't match the run code. // This is an AK problem... icon: () => , id: 'search', tooltip: 'Search for documentation', onClick: () => this.setState({ showSearchDrawer: true }), }, ]} secondaryItems={[]} /> )} productNavigation={() => null} containerNavigation={navContent} > {children} this.setState({ showSearchDrawer: false })} /> ); } } export default NavigationWrapper;