diff --git a/packages/app/src/components/Layout/drawer/index.jsx b/packages/app/src/components/Layout/drawer/index.jsx index 2a71cbc8..b83930cf 100755 --- a/packages/app/src/components/Layout/drawer/index.jsx +++ b/packages/app/src/components/Layout/drawer/index.jsx @@ -1,4 +1,5 @@ import React from "react" +import { Drawer as AntdDrawer } from "antd" import { DraggableDrawer } from "components" import { EventBus } from "evite" @@ -42,6 +43,7 @@ export default class DrawerController extends React.Component { if (typeof addresses[id] === "undefined") { drawers.push() + addresses[id] = drawers.length - 1 refs[id] = instance.ref } else { @@ -101,6 +103,7 @@ export class Drawer extends React.Component { events = new EventBus() state = { + type: this.options.type ?? "right", visible: true, locked: false, } @@ -170,9 +173,11 @@ export class Drawer extends React.Component { ref: this.props.ref, key: this.props.id, onRequestClose: this.close, + onClose: this.close, open: this.state.visible, containerElementClass: "drawer", modalElementClass: "body", + destroyOnClose: true, } const componentProps = { ...this.options.componentProps, @@ -182,8 +187,22 @@ export class Drawer extends React.Component { handleFail: this.handleFail, } - return - {React.createElement(this.props.children, componentProps)} - + switch (this.options.type) { + case "drawer": { + return + { + React.createElement(this.props.children, componentProps) + } + + } + + case "default": { + return + { + React.createElement(this.props.children, componentProps) + } + + } + } } } \ No newline at end of file