feat: add payment trasnactions.

This commit is contained in:
elforjani13
2021-12-14 17:56:42 +02:00
parent ae7d37a0e0
commit 6aba694518
19 changed files with 448 additions and 382 deletions

View File

@@ -5,7 +5,6 @@ import {
useBill,
useTransactionsByReference,
useBillLocatedLandedCost,
useBillPaymentTransactions,
} from 'hooks/query';
const BillDrawerContext = React.createContext();
@@ -34,31 +33,15 @@ function BillDrawerProvider({ billId, ...props }) {
enabled: !!billId,
});
// Handle fetch bill payment transaction.
const {
isLoading: isPaymentTransactionsLoading,
isFetching: isPaymentTransactionFetching,
data: paymentTransactions,
} = useBillPaymentTransactions(billId, {
enabled: !!billId,
});
//provider.
const provider = {
transactions,
billId,
data,
bill,
paymentTransactions,
isPaymentTransactionsLoading,
isPaymentTransactionFetching,
};
const loading =
isLandedCostLoading ||
isTransactionLoading ||
isPaymentTransactionsLoading ||
isBillLoading;
const loading = isLandedCostLoading || isTransactionLoading || isBillLoading;
return (
<DrawerLoading loading={loading}>