mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: bill Drawer.
This commit is contained in:
13
client/src/containers/Drawers/BillDrawer/BillDrawerAlerts.js
Normal file
13
client/src/containers/Drawers/BillDrawer/BillDrawerAlerts.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import BillTransactionDeleteAlert from 'containers/Alerts/Bills/BillTransactionDeleteAlert';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bill drawer alert.
|
||||||
|
*/
|
||||||
|
export default function BillDrawerAlerts() {
|
||||||
|
return (
|
||||||
|
<div class="bills-alerts">
|
||||||
|
<BillTransactionDeleteAlert name="transaction-delete" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BillDrawerProvider } from './BillDrawerProvider';
|
import { BillDrawerProvider } from './BillDrawerProvider';
|
||||||
import BillDrawerDetails from './BillDrawerDetails';
|
import BillDrawerDetails from './BillDrawerDetails';
|
||||||
|
import BillDrawerAlerts from './BillDrawerAlerts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bill drawer content.
|
* Bill drawer content.
|
||||||
*/
|
*/
|
||||||
export default function BillDrawerContent({
|
export default function BillDrawerContent({
|
||||||
// #ownProp
|
// #ownProp
|
||||||
billId,
|
bill,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<BillDrawerProvider billId={billId}>
|
<BillDrawerProvider billId={bill}>
|
||||||
<BillDrawerDetails />
|
<BillDrawerDetails />
|
||||||
|
<BillDrawerAlerts />
|
||||||
</BillDrawerProvider>
|
</BillDrawerProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
import { DrawerHeaderContent, DashboardInsider } from 'components';
|
||||||
|
import { useBillLocatedLandedCost } from 'hooks/query';
|
||||||
|
|
||||||
const BillDrawerContext = React.createContext();
|
const BillDrawerContext = React.createContext();
|
||||||
|
|
||||||
@@ -8,10 +9,18 @@ const BillDrawerContext = React.createContext();
|
|||||||
* Bill drawer provider.
|
* Bill drawer provider.
|
||||||
*/
|
*/
|
||||||
function BillDrawerProvider({ billId, ...props }) {
|
function BillDrawerProvider({ billId, ...props }) {
|
||||||
|
// Handle fetch bill located landed cost transaction.
|
||||||
|
const { isLoading: isLandedCostLoading, data: transactions } =
|
||||||
|
useBillLocatedLandedCost(billId, {
|
||||||
|
enabled: !!billId,
|
||||||
|
});
|
||||||
|
|
||||||
//provider.
|
//provider.
|
||||||
const provider = {};
|
const provider = {
|
||||||
|
transactions,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<DashboardInsider>
|
<DashboardInsider loading={isLandedCostLoading}>
|
||||||
<DrawerHeaderContent
|
<DrawerHeaderContent
|
||||||
name="bill-drawer"
|
name="bill-drawer"
|
||||||
title={intl.get('bill_details')}
|
title={intl.get('bill_details')}
|
||||||
|
|||||||
Reference in New Issue
Block a user