mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
refactoring(*): paper drawer.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import React, { lazy } from 'react';
|
||||
import withDrawers from 'containers/Drawer/withDrawers';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { Drawer, DrawerSuspense } from 'components';
|
||||
import { compose } from 'utils';
|
||||
@@ -16,15 +15,10 @@ function InvoiceDrawer({
|
||||
isOpen,
|
||||
payload: { invoiceId },
|
||||
|
||||
closeDrawer,
|
||||
}) {
|
||||
// handle close Drawer
|
||||
const handleDrawerClose = () => {
|
||||
closeDrawer(name);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Drawer isOpen={isOpen} isClose={handleDrawerClose}>
|
||||
<Drawer isOpen={isOpen} name={name}>
|
||||
<DrawerSuspense>
|
||||
<InvoicesDrawerContent invoiceId={invoiceId} />
|
||||
</DrawerSuspense>
|
||||
@@ -32,4 +26,4 @@ function InvoiceDrawer({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDrawers(), withDrawerActions)(InvoiceDrawer);
|
||||
export default compose(withDrawers())(InvoiceDrawer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { useInvoice } from 'hooks/query';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
||||
|
||||
const InvoiceDrawerContext = createContext();
|
||||
|
||||
@@ -26,6 +26,7 @@ function InvoiceDrawerProvider({ invoiceId, ...props }) {
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={isInvoiceLoading}>
|
||||
<DrawerHeaderContent name={'invoice-drawer'} />
|
||||
<InvoiceDrawerContext.Provider value={provider} {...props} />
|
||||
</DashboardInsider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user