index.js 519 Bytes
Newer Older
jiang's avatar
jiang committed
1
import 'rc-drawer-menu/assets/index.css';
2
import React from 'react';
jiang's avatar
jiang committed
3 4
import DrawerMenu from 'rc-drawer-menu';
import SiderMenu from './SiderMenu';
偏右's avatar
偏右 committed
5

6 7 8 9 10 11 12 13 14 15 16 17 18 19
export default props => (
  props.isMobile ? (
    <DrawerMenu
      parent={null}
      level={null}
      iconChild={null}
      open={!props.collapsed}
      onMaskClick={() => { props.onCollapse(true); }}
      width="256px"
    >
      <SiderMenu {...props} collapsed={props.isMobile ? false : props.collapsed} />
    </DrawerMenu>
  ) : <SiderMenu {...props} />
);