mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00: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';
|
||||
@@ -15,17 +14,10 @@ const ReceiptDrawer = ({
|
||||
//#withDrawer
|
||||
isOpen,
|
||||
payload: { receiptId },
|
||||
|
||||
closeDrawer,
|
||||
}) => {
|
||||
// handle close Drawer
|
||||
const handleDrawerClose = () => {
|
||||
closeDrawer(name);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Drawer isOpen={isOpen} isClose={handleDrawerClose}>
|
||||
<Drawer isOpen={isOpen} name={name}>
|
||||
<DrawerSuspense>
|
||||
<ReceiptDrawerContent receiptId={receiptId} />
|
||||
</DrawerSuspense>
|
||||
@@ -34,4 +26,4 @@ const ReceiptDrawer = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default compose(withDrawers(), withDrawerActions)(ReceiptDrawer);
|
||||
export default compose(withDrawers())(ReceiptDrawer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { useReceipt } from 'hooks/query';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
||||
|
||||
const ReceiptDrawerContext = createContext();
|
||||
|
||||
@@ -23,6 +23,7 @@ function ReceiptDrawerProvider({ receiptId, ...props }) {
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={isReceiptLoading}>
|
||||
<DrawerHeaderContent name={'receipt-drawer'} />
|
||||
<ReceiptDrawerContext.Provider value={provider} {...props} />
|
||||
</DashboardInsider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user