diff --git a/client/src/common/drawers.js b/client/src/common/drawers.js
index af7978a77..4fb36ed80 100644
--- a/client/src/common/drawers.js
+++ b/client/src/common/drawers.js
@@ -7,5 +7,6 @@ export const DRAWERS = {
ACCOUNT_DRAWER: 'account-drawer',
JOURNAL_DRAWER: 'journal-drawer',
EXPENSE_DRAWER: 'expense-drawer',
+ BILL_DRAWER: 'bill-drawer',
INVENTORY_ADJUSTMENT_DRAWER: 'inventory-adjustment-drawer',
};
diff --git a/client/src/components/Drawer/DrawerSuspense.js b/client/src/components/Drawer/DrawerSuspense.js
index c6d1fddf0..d9df19978 100644
--- a/client/src/components/Drawer/DrawerSuspense.js
+++ b/client/src/components/Drawer/DrawerSuspense.js
@@ -1,12 +1,11 @@
import React, { Suspense } from 'react';
-import { Spinner, Classes } from '@blueprintjs/core';
+import { DrawerLoading } from 'components';
+/**
+ * Loading content.
+ */
function LoadingContent() {
- return (
-
-
-
- );
+ return ;
}
export default function DrawerSuspense({ children }) {
diff --git a/client/src/components/Drawer/index.js b/client/src/components/Drawer/index.js
new file mode 100644
index 000000000..005735517
--- /dev/null
+++ b/client/src/components/Drawer/index.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import { Classes } from '@blueprintjs/core';
+import LoadingIndicator from 'components/LoadingIndicator';
+
+export function DrawerLoading({ loading, mount = false, children }) {
+ return (
+
+ {children}
+
+ );
+}
+
+export function DrawerBody({ children }) {
+ return {children}
;
+}
diff --git a/client/src/components/DrawersContainer.js b/client/src/components/DrawersContainer.js
index a3858fa2d..e35b17f1d 100644
--- a/client/src/components/DrawersContainer.js
+++ b/client/src/components/DrawersContainer.js
@@ -25,7 +25,7 @@ export default function DrawersContainer() {
-
+
diff --git a/client/src/components/index.js b/client/src/components/index.js
index 68db361f5..7b3497368 100644
--- a/client/src/components/index.js
+++ b/client/src/components/index.js
@@ -75,6 +75,7 @@ export * from './TotalLines/index'
export * from './Alert';
export * from './Subscriptions';
export * from './Dashboard';
+export * from './Drawer';
const Hint = FieldHint;
diff --git a/client/src/containers/Drawers/AccountDrawer/AccountDrawerContent.js b/client/src/containers/Drawers/AccountDrawer/AccountDrawerContent.js
index 3bf0bf706..b1b5e79a9 100644
--- a/client/src/containers/Drawers/AccountDrawer/AccountDrawerContent.js
+++ b/client/src/containers/Drawers/AccountDrawer/AccountDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import 'style/components/Drawers/AccountDrawer.scss';
@@ -11,11 +12,13 @@ import AccountDrawerDetails from './AccountDrawerDetails';
export default function AccountDrawerContent({
// #ownProp
accountId,
- name
+ name,
}) {
return (
-
+
+
+
);
-}
\ No newline at end of file
+}
diff --git a/client/src/containers/Drawers/AccountDrawer/AccountDrawerDetails.js b/client/src/containers/Drawers/AccountDrawer/AccountDrawerDetails.js
index 6ac80c2b6..2ee430cd1 100644
--- a/client/src/containers/Drawers/AccountDrawer/AccountDrawerDetails.js
+++ b/client/src/containers/Drawers/AccountDrawer/AccountDrawerDetails.js
@@ -11,11 +11,13 @@ import AccountDrawerTable from './AccountDrawerTable';
*/
export default function AccountDrawerDetails() {
return (
-
+
);
diff --git a/client/src/containers/Drawers/AccountDrawer/AccountDrawerProvider.js b/client/src/containers/Drawers/AccountDrawer/AccountDrawerProvider.js
index 5f36a3322..2bf24c129 100644
--- a/client/src/containers/Drawers/AccountDrawer/AccountDrawerProvider.js
+++ b/client/src/containers/Drawers/AccountDrawer/AccountDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import { useAccount, useAccountTransactions } from 'hooks/query';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
const AccountDrawerContext = React.createContext();
@@ -22,7 +22,7 @@ function AccountDrawerProvider({ accountId, name, ...props }) {
// Drawer title.
const drawerTitle = `${account.name} ${account.code}`;
- // provider.
+ // Provider.
const provider = {
accountId,
account,
@@ -31,10 +31,10 @@ function AccountDrawerProvider({ accountId, name, ...props }) {
};
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/AccountDrawer/index.js b/client/src/containers/Drawers/AccountDrawer/index.js
index 52afe9ac7..b4704b40c 100644
--- a/client/src/containers/Drawers/AccountDrawer/index.js
+++ b/client/src/containers/Drawers/AccountDrawer/index.js
@@ -19,10 +19,7 @@ function AccountDrawer({
diff --git a/client/src/containers/Drawers/BillDrawer/BillDrawerContent.js b/client/src/containers/Drawers/BillDrawer/BillDrawerContent.js
index abe8932fa..bd6e6338a 100644
--- a/client/src/containers/Drawers/BillDrawer/BillDrawerContent.js
+++ b/client/src/containers/Drawers/BillDrawer/BillDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import 'style/components/Drawers/ViewDetail/ViewDetail.scss';
@@ -15,8 +16,9 @@ export default function BillDrawerContent({
}) {
return (
-
- {/* */}
+
+
+
);
}
diff --git a/client/src/containers/Drawers/BillDrawer/BillDrawerProvider.js b/client/src/containers/Drawers/BillDrawer/BillDrawerProvider.js
index b8d880fbf..bef541bb0 100644
--- a/client/src/containers/Drawers/BillDrawer/BillDrawerProvider.js
+++ b/client/src/containers/Drawers/BillDrawer/BillDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import {
useBill,
useTransactionsByReference,
@@ -41,16 +41,16 @@ function BillDrawerProvider({ billId, ...props }) {
bill,
};
+ const loading = isLandedCostLoading || isTransactionLoading || isBillLoading;
+
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerContent.js b/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerContent.js
index f6862ff37..27e2839da 100644
--- a/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerContent.js
+++ b/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerContent.js
@@ -1,5 +1,6 @@
import React from 'react';
+import { DrawerBody } from 'components';
import CustomerDetails from './CustomerDetails';
import { CustomerDetailsDrawerProvider } from './CustomerDetailsDrawerProvider';
@@ -12,7 +13,9 @@ export default function CustomerDetailsDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerProvider.js b/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerProvider.js
index f0579272c..8b8a981ce 100644
--- a/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerProvider.js
+++ b/client/src/containers/Drawers/CustomerDetailsDrawer/CustomerDetailsDrawerProvider.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useCustomer } from 'hooks/query';
const ContactDetailDrawerContext = React.createContext();
@@ -23,13 +23,13 @@ function CustomerDetailsDrawerProvider({ customerId, ...props }) {
};
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerContent.js b/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerContent.js
index 8b3ecf215..59e47bbdb 100644
--- a/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerContent.js
+++ b/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import EstimateDetail from './EstimateDetail';
import { EstimateDetailDrawerProvider } from './EstimateDetailDrawerProvider';
@@ -12,7 +13,9 @@ export default function EstimateDetailDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerProvider.js b/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerProvider.js
index 646ba0fc3..bf11ea143 100644
--- a/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerProvider.js
+++ b/client/src/containers/Drawers/EstimateDetailDrawer/EstimateDetailDrawerProvider.js
@@ -1,7 +1,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import { useEstimate } from 'hooks/query';
-import { DrawerHeaderContent, DrawerInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
const EstimateDetailDrawerContext = React.createContext();
@@ -21,13 +21,13 @@ function EstimateDetailDrawerProvider({ estimateId, ...props }) {
};
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerContent.js b/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerContent.js
index c84c074f4..810533ade 100644
--- a/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerContent.js
+++ b/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerContent.js
@@ -1,5 +1,7 @@
import React from 'react';
+import { DrawerBody } from 'components';
+
import 'style/components/Drawers/ExpenseDrawer.scss';
import { ExpenseDrawerProvider } from './ExpenseDrawerProvider';
@@ -14,7 +16,9 @@ export default function ExpenseDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js b/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js
index f16cbdddc..90e4b87a1 100644
--- a/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js
+++ b/client/src/containers/Drawers/ExpenseDrawer/ExpenseDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import { useExpense } from 'hooks/query';
-import { DashboardInsider } from 'components';
+import { DrawerLoading } from 'components';
const ExpenseDrawerDrawerContext = React.createContext();
@@ -25,10 +25,11 @@ function ExpenseDrawerProvider({ expenseId, ...props }) {
isExpenseFetching,
isExpenseLoading,
};
+
return (
-
+
-
+
);
}
const useExpenseDrawerContext = () =>
diff --git a/client/src/containers/Drawers/ExpenseDrawer/index.js b/client/src/containers/Drawers/ExpenseDrawer/index.js
index aadfe7946..1764da1fa 100644
--- a/client/src/containers/Drawers/ExpenseDrawer/index.js
+++ b/client/src/containers/Drawers/ExpenseDrawer/index.js
@@ -1,7 +1,8 @@
import React, { lazy } from 'react';
+import intl from 'react-intl-universal';
+
import { Drawer, DrawerSuspense } from 'components';
import withDrawers from 'containers/Drawer/withDrawers';
-import intl from 'react-intl-universal';
import { compose } from 'utils';
@@ -13,7 +14,7 @@ const ExpenseDrawerContent = lazy(() => import('./ExpenseDrawerContent'));
function ExpenseDrawer({
name,
- //#withDrawer
+ // #withDrawer
isOpen,
payload: { expenseId },
}) {
@@ -23,10 +24,7 @@ function ExpenseDrawer({
name={name}
title={intl.get('expense')}
size={'65%'}
- style={{
- minWidth: '700px',
- maxWidth: '900px',
- }}
+ style={{ minWidth: '700px', maxWidth: '900px' }}
>
diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js
index 3e6476f07..9c7e6b6c6 100644
--- a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js
+++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetail.js
@@ -16,6 +16,7 @@ export default function InventoryAdjustmentDetail() {
return (
+
diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js
index f054fb2ec..e97eee29c 100644
--- a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js
+++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDetailActionsBar.js
@@ -26,9 +26,7 @@ function InventoryAdjustmentDetailActionsBar({
// Handle delete inventory adjustment.
const handleDeleteInventoryAdjustment = () => {
- openAlert('inventory-adjustment-delete', {
- inventoryId,
- });
+ openAlert('inventory-adjustment-delete', { inventoryId });
closeDrawer('inventory-adjustment-drawer');
};
diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerContent.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerContent.js
index c6555fafc..596461354 100644
--- a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerContent.js
+++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import InventoryAdjustmentDetail from './InventoryAdjustmentDetail';
import { InventoryAdjustmentDrawerProvider } from './InventoryAdjustmentDrawerProvider';
@@ -9,7 +10,9 @@ import { InventoryAdjustmentDrawerProvider } from './InventoryAdjustmentDrawerPr
export default function InventoryAdjustmentDrawerContent({ inventoryId }) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerProvider.js b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerProvider.js
index de07d0882..dd7b77f63 100644
--- a/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerProvider.js
+++ b/client/src/containers/Drawers/InventoryAdjustmentDetailDrawer/InventoryAdjustmentDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useInventoryAdjustment } from 'hooks/query';
const InventoryAdjustmentDrawerContext = React.createContext();
@@ -22,14 +22,13 @@ function InventoryAdjustmentDrawerProvider({ inventoryId, ...props }) {
};
return (
-
+
-
-
+
);
}
diff --git a/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerContent.js b/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerContent.js
index 9d2ff7991..f0f02e483 100644
--- a/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerContent.js
+++ b/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import 'style/components/Drawers/ViewDetail/ViewDetail.scss';
@@ -14,7 +15,9 @@ export default function InvoiceDetailDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerProvider.js b/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerProvider.js
index d19a5906e..ccb64799b 100644
--- a/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerProvider.js
+++ b/client/src/containers/Drawers/InvoiceDetailDrawer/InvoiceDetailDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useTransactionsByReference, useInvoice } from 'hooks/query';
const InvoiceDetailDrawerContext = React.createContext();
@@ -32,13 +32,13 @@ function InvoiceDetailDrawerProvider({ invoiceId, ...props }) {
invoice,
};
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerContent.js b/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerContent.js
index 46ade648f..468fcaca3 100644
--- a/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerContent.js
+++ b/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerContent.js
@@ -2,6 +2,7 @@ import React from 'react';
import 'style/components/Drawers/ItemDrawer.scss';
+import { DrawerBody } from 'components';
import ItemContentDetails from './ItemContentDetails';
import { ItemDetailDrawerProvider } from './ItemDetailDrawerProvider';
@@ -14,7 +15,9 @@ export default function ItemDetailDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js b/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js
index 095f19962..bb83783b3 100644
--- a/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js
+++ b/client/src/containers/Drawers/ItemDetailDrawer/ItemDetailDrawerProvider.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useItem } from 'hooks/query';
const ItemDetailDrawerContext = React.createContext();
@@ -21,10 +21,10 @@ function ItemDetailDrawerProvider({ itemId, ...props }) {
};
return (
-
+
-
+
);
}
const useItemDetailDrawerContext = () =>
diff --git a/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerContent.js b/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerContent.js
index 905dd2174..7558f9951 100644
--- a/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerContent.js
+++ b/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerContent.js
@@ -1,5 +1,7 @@
import React from 'react';
+import { DrawerBody } from 'components';
+
import 'style/components/Drawers/ViewDetails.scss';
import { ManualJournalDrawerProvider } from './ManualJournalDrawerProvider';
@@ -14,7 +16,9 @@ export default function ManualJournalDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerProvider.js b/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerProvider.js
index 527e259bb..0d007e7fb 100644
--- a/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerProvider.js
+++ b/client/src/containers/Drawers/ManualJournalDrawer/ManualJournalDrawerProvider.js
@@ -1,7 +1,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import { useJournal } from 'hooks/query';
-import { DashboardInsider, DrawerHeaderContent } from 'components';
+import { DrawerLoading, DrawerHeaderContent } from 'components';
const ManualJournalDrawerContext = React.createContext();
@@ -28,7 +28,7 @@ function ManualJournalDrawerProvider({ manualJournalId, ...props }) {
};
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/ManualJournalDrawer/index.js b/client/src/containers/Drawers/ManualJournalDrawer/index.js
index eeecfc894..75b6667bb 100644
--- a/client/src/containers/Drawers/ManualJournalDrawer/index.js
+++ b/client/src/containers/Drawers/ManualJournalDrawer/index.js
@@ -14,7 +14,7 @@ const ManualJournalDrawerContent = lazy(() =>
function ManualJournalDrawer({
name,
- //#withDrawer
+ // #withDrawer
isOpen,
payload: { manualJournalId },
}) {
@@ -23,10 +23,7 @@ function ManualJournalDrawer({
isOpen={isOpen}
name={name}
size={'65%'}
- style={{
- minWidth: '700px',
- maxWidth: '900px',
- }}
+ style={{ minWidth: '700px', maxWidth: '900px' }}
>
diff --git a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailContent.js b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailContent.js
index 5bab91ee3..c3f804381 100644
--- a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailContent.js
+++ b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import 'style/components/Drawers/ViewDetail/ViewDetail.scss';
@@ -14,7 +15,9 @@ export default function PaymentMadeDetailContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
index d1d1cdb4b..bb22f3756 100644
--- a/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
+++ b/client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDetailProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import {
useTransactionsByReference,
usePaymentMade,
@@ -46,16 +46,18 @@ function PaymentMadeDetailProvider({ paymentMadeId, ...props }) {
paymentMade,
paymentEntries,
};
+
+ const loading =
+ isTransactionLoading || isPaymentMadeLoading || isPaymentLoading;
+
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
index 2990085e1..1f4939feb 100644
--- a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
+++ b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveActionsBar.js
@@ -20,6 +20,9 @@ import { Icon, FormattedMessage as T } from 'components';
import { compose } from 'utils';
+/**
+ * Payment receive actions bar.
+ */
function PaymentReceiveActionsBar({
// #withAlertsActions
openAlert,
diff --git a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailContent.js b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailContent.js
index bb246b8b0..8837dd08c 100644
--- a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailContent.js
+++ b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailContent.js
@@ -1,5 +1,6 @@
import React from 'react';
+import { DrawerBody } from 'components';
import PaymentReceiveDetail from './PaymentReceiveDetail';
import { PaymentReceiveDetailProvider } from './PaymentReceiveDetailProvider';
@@ -12,7 +13,9 @@ export default function PaymentReceiveDetailContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
index 85117e1f3..aa79010e1 100644
--- a/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
+++ b/client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDetailProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useTransactionsByReference, usePaymentReceive } from 'hooks/query';
const PaymentReceiveDetailContext = React.createContext();
@@ -30,16 +30,21 @@ function PaymentReceiveDetailProvider({ paymentReceiveId, ...props }) {
);
// Provider.
- const provider = { transactions, paymentReceive, paymentReceiveId };
+ const provider = {
+ isPaymentFetching,
+ transactions,
+ paymentReceive,
+ paymentReceiveId,
+ };
return (
-
+
-
+
);
}
diff --git a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerContent.js b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerContent.js
index c01872156..29fc0d98d 100644
--- a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerContent.js
+++ b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerContent.js
@@ -1,4 +1,5 @@
import React from 'react';
+import { DrawerBody } from 'components';
import 'style/components/Drawers/ViewDetail/ViewDetail.scss';
@@ -14,7 +15,9 @@ export default function ReceiptDetailDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerProvider.js b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerProvider.js
index 57dfd8d43..41365d214 100644
--- a/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerProvider.js
+++ b/client/src/containers/Drawers/ReceiptDetailDrawer/ReceiptDetailDrawerProvider.js
@@ -1,6 +1,6 @@
import React from 'react';
import intl from 'react-intl-universal';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useTransactionsByReference, useReceipt } from 'hooks/query';
// useTransactionsByReference
@@ -30,21 +30,23 @@ function ReceiptDetailDrawerProvider({ receiptId, ...props }) {
{ enabled: !!receiptId },
);
- //provider.
+ // Provider.
const provider = {
transactions,
receiptId,
receipt,
};
+ const loading = isTransactionLoading || isReceiptLoading;
+
return (
-
+
-
+
);
}
const useReceiptDetailDrawerContext = () =>
diff --git a/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerContent.js b/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerContent.js
index 8b5b3503a..d39d157a5 100644
--- a/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerContent.js
+++ b/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerContent.js
@@ -1,5 +1,6 @@
import React from 'react';
+import { DrawerBody } from 'components';
import VendorDetails from './VendorDetails';
import { VendorDetailsDrawerProvider } from './VendorDetailsDrawerProvider';
@@ -12,7 +13,9 @@ export default function VendorDetailsDrawerContent({
}) {
return (
-
+
+
+
);
}
diff --git a/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerProvider.js b/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerProvider.js
index 60e701a04..1f44b1fab 100644
--- a/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerProvider.js
+++ b/client/src/containers/Drawers/VendorDetailsDrawer/VendorDetailsDrawerProvider.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { DrawerHeaderContent, DashboardInsider } from 'components';
+import { DrawerHeaderContent, DrawerLoading } from 'components';
import { useVendor } from 'hooks/query';
const VendorDetailDrawerContext = React.createContext();
@@ -9,12 +9,9 @@ const VendorDetailDrawerContext = React.createContext();
*/
function VendorDetailsDrawerProvider({ vendorId, ...props }) {
// Handle fetch vendor details.
- const { data: vendor, isLoading: isVendorLoading } = useVendor(
- vendorId,
- {
- enabled: !!vendorId,
- },
- );
+ const { data: vendor, isLoading: isVendorLoading } = useVendor(vendorId, {
+ enabled: !!vendorId,
+ });
// Provider.
const provider = {
vendor,
@@ -23,13 +20,13 @@ function VendorDetailsDrawerProvider({ vendorId, ...props }) {
};
return (
-
+
-
+
);
}