feat: add style of bill.

This commit is contained in:
elforjani13
2021-12-20 15:31:03 +02:00
parent a0098382e7
commit 3511348d04
15 changed files with 265 additions and 152 deletions

View File

@@ -1,11 +1,7 @@
import React from 'react';
import intl from 'react-intl-universal';
import { DrawerHeaderContent, DrawerLoading } from 'components';
import {
useBill,
useTransactionsByReference,
useBillLocatedLandedCost,
} from 'hooks/query';
import { useBill, useBillLocatedLandedCost } from 'hooks/query';
const BillDrawerContext = React.createContext();
@@ -18,15 +14,6 @@ function BillDrawerProvider({ billId, ...props }) {
enabled: !!billId,
});
// Handle fetch transaction by reference.
const { data, isLoading: isTransactionLoading } = useTransactionsByReference(
{
reference_id: billId,
reference_type: 'Bill',
},
{ enabled: !!billId },
);
// Handle fetch bill located landed cost transaction.
const { isLoading: isLandedCostLoading, data: transactions } =
useBillLocatedLandedCost(billId, {
@@ -35,13 +22,12 @@ function BillDrawerProvider({ billId, ...props }) {
//provider.
const provider = {
transactions,
billId,
data,
transactions,
bill,
};
const loading = isLandedCostLoading || isTransactionLoading || isBillLoading;
const loading = isLandedCostLoading || isBillLoading;
return (
<DrawerLoading loading={loading}>