index.js 536 Bytes
Newer Older
1
import React from 'react';
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
2
import { Drawer } from 'antd';
jiang's avatar
jiang committed
3
import SiderMenu from './SiderMenu';
偏右's avatar
偏右 committed
4

5 6 7
const SiderMenuWrapper = props => {
  const { isMobile, collapsed } = props;
  return isMobile ? (
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
8 9 10 11 12
    <Drawer
      visible={!collapsed}
      placement="left"
      style={{
        padding: 0,
13
      }}
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
14
      onClose={() => {
jim's avatar
jim committed
15 16
        props.onCollapse(true);
      }}
17
    >
18
      <SiderMenu {...props} collapsed={isMobile ? false : collapsed} />
ι™ˆεΈ…'s avatar
ι™ˆεΈ… committed
19
    </Drawer>
jim's avatar
jim committed
20 21 22
  ) : (
    <SiderMenu {...props} />
  );
23
};
ZHAO Jinxiang's avatar
ZHAO Jinxiang committed
24 25

export default SiderMenuWrapper;