import 'rc-drawer-menu/assets/index.css'; import React from 'react'; import DrawerMenu from 'rc-drawer-menu'; import SiderMenu from './SiderMenu'; /** * Recursively flatten the data * [{path:string},{path:string}] => {path,path2} * @param menus */ const getFlatMenuKeys = menuData => { let keys = []; menuData.forEach(item => { if (item.children) { keys = keys.concat(getFlatMenuKeys(item.children)); } keys.push(item.path); }); return keys; }; const SiderMenuWrapper = props => props.isMobile || props.fixSiderbar ? ( { props.onCollapse(true); }} width="256px" > ) : ( ); export default SiderMenuWrapper;