mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
refactoring(*): paper drawer.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React, { lazy } from 'react';
|
||||
import { Drawer, DrawerSuspense } from 'components';
|
||||
import withDrawers from 'containers/Drawer/withDrawers';
|
||||
import withDrawerActions from 'containers/Drawer/withDrawerActions';
|
||||
|
||||
import { compose } from 'utils';
|
||||
|
||||
@@ -15,15 +14,9 @@ function EstimateDrawer({
|
||||
//#withDrawer
|
||||
isOpen,
|
||||
payload: { estimateId },
|
||||
|
||||
closeDrawer,
|
||||
}) {
|
||||
// handle close Drawer
|
||||
const handleDrawerClose = () => {
|
||||
closeDrawer(name);
|
||||
};
|
||||
return (
|
||||
<Drawer isOpen={isOpen} isClose={handleDrawerClose}>
|
||||
<Drawer isOpen={isOpen} name={name}>
|
||||
<DrawerSuspense>
|
||||
<EstimateDrawerContent estimateId={estimateId} />
|
||||
</DrawerSuspense>
|
||||
@@ -31,4 +24,4 @@ function EstimateDrawer({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDrawers(), withDrawerActions)(EstimateDrawer);
|
||||
export default compose(withDrawers())(EstimateDrawer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { createContext } from 'react';
|
||||
import { useEstimate } from 'hooks/query';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
||||
|
||||
const EstimateDrawerContext = createContext();
|
||||
|
||||
@@ -24,6 +24,7 @@ function EstimateDrawerProvider({ estimateId, ...props }) {
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={isEstimateLoading}>
|
||||
<DrawerHeaderContent name={'estimate-drawer'} />
|
||||
<EstimateDrawerContext.Provider value={provider} {...props} />
|
||||
</DashboardInsider>
|
||||
);
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
|
||||
@@ -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';
|
||||
@@ -18,15 +17,10 @@ function PaymentReceiveDrawer({
|
||||
isOpen,
|
||||
payload: { paymentReceiveId },
|
||||
|
||||
closeDrawer,
|
||||
}) {
|
||||
// handle close Drawer
|
||||
const handleDrawerClose = () => {
|
||||
closeDrawer(name);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<Drawer isOpen={isOpen} isClose={handleDrawerClose}>
|
||||
<Drawer isOpen={isOpen} name={name}>
|
||||
<DrawerSuspense>
|
||||
<PaymentReceiveDrawerContent paymentReceiveId={paymentReceiveId} />
|
||||
</DrawerSuspense>
|
||||
@@ -34,4 +28,4 @@ function PaymentReceiveDrawer({
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(withDrawers(), withDrawerActions)(PaymentReceiveDrawer);
|
||||
export default compose(withDrawers())(PaymentReceiveDrawer);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { createContext, useContext } from 'react';
|
||||
import { usePaymentReceive } from 'hooks/query';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
||||
|
||||
const PaymentReceiveDrawerContext = createContext();
|
||||
|
||||
@@ -20,6 +20,7 @@ function PaymentReceiveDrawerProvider({ paymentReceiveId, ...props }) {
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={isPaymentReceiveLoading}>
|
||||
<DrawerHeaderContent name={'payment-receive-drawer'} />
|
||||
<PaymentReceiveDrawerContext.Provider value={provider} {...props} />
|
||||
</DashboardInsider>
|
||||
);
|
||||
|
||||
@@ -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