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

ZHAO Jinxiang's avatar
ZHAO Jinxiang committed
6
const SiderMenuWrapper = props =>
7 8
  props.isMobile ? (
    <DrawerMenu
9
      getContainer={null}
10
      level={null}
11 12 13 14
      handleChild={<i className="drawer-handle-icon" />}
      onHandleClick={() => {
        props.onCollapse(!props.collapsed);
      }}
15
      open={!props.collapsed}
jim's avatar
jim committed
16 17 18
      onMaskClick={() => {
        props.onCollapse(true);
      }}
19 20 21
    >
      <SiderMenu {...props} collapsed={props.isMobile ? false : props.collapsed} />
    </DrawerMenu>
jim's avatar
jim committed
22 23 24
  ) : (
    <SiderMenu {...props} />
  );
ZHAO Jinxiang's avatar
ZHAO Jinxiang committed
25 26

export default SiderMenuWrapper;