diff --git a/src/components/Redoc/Redoc.tsx b/src/components/Redoc/Redoc.tsx index f734e689..2b43e77d 100644 --- a/src/components/Redoc/Redoc.tsx +++ b/src/components/Redoc/Redoc.tsx @@ -53,7 +53,7 @@ export class Redoc extends React.Component { /> )) || null} - + diff --git a/src/components/SideMenu/SideMenu.tsx b/src/components/SideMenu/SideMenu.tsx index 47df1557..f63d9c46 100644 --- a/src/components/SideMenu/SideMenu.tsx +++ b/src/components/SideMenu/SideMenu.tsx @@ -2,6 +2,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { IMenuItem, MenuStore } from '../../services/MenuStore'; +import { OptionsContext } from '../OptionsProvider'; import { MenuItems } from './MenuItems'; import { PerfectScrollbarWrap } from '../../common-elements/perfect-scrollbar'; @@ -10,9 +11,9 @@ import { RedocAttribution } from './styled.elements'; @observer export class SideMenu extends React.Component<{ menu: MenuStore; - menuToggle?: boolean; className?: string; }> { + static contextType = OptionsContext; private _updateScroll?: () => void; render() { @@ -36,7 +37,7 @@ export class SideMenu extends React.Component<{ } activate = (item: IMenuItem) => { - if (item && item.active && this.props.menuToggle) { + if (item && item.active && this.context.menuToggle) { return item.expanded ? item.collapse() : item.expand(); }