mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
re-structure to monorepo.
This commit is contained in:
38
packages/webapp/src/components/Drawer/Drawer.tsx
Normal file
38
packages/webapp/src/components/Drawer/Drawer.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
// @ts-nocheck
|
||||
import React from 'react';
|
||||
import { Position, Drawer } from '@blueprintjs/core';
|
||||
|
||||
import '@/style/components/Drawer.scss';
|
||||
|
||||
import { DrawerProvider } from './DrawerProvider';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
* Drawer component.
|
||||
*/
|
||||
function DrawerComponent(props) {
|
||||
const { name, children, onClose, closeDrawer } = props;
|
||||
|
||||
const handleClose = (event) => {
|
||||
closeDrawer(name);
|
||||
onClose && onClose(event);
|
||||
};
|
||||
|
||||
return (
|
||||
<Drawer
|
||||
size={'700px'}
|
||||
canOutsideClickClose={true}
|
||||
canEscapeKeyClose={true}
|
||||
position={Position.RIGHT}
|
||||
onClose={handleClose}
|
||||
portalClassName={'drawer-portal'}
|
||||
{...props}
|
||||
>
|
||||
<DrawerProvider {...props}>{children}</DrawerProvider>
|
||||
</Drawer>
|
||||
);
|
||||
}
|
||||
|
||||
const DrawerRoot = compose(withDrawerActions)(DrawerComponent);
|
||||
export { DrawerRoot as Drawer };
|
||||
Reference in New Issue
Block a user