mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
feat: improve UI experience of resource priting
This commit is contained in:
@@ -31,11 +31,13 @@ import {
|
||||
PaymentReceiveAction,
|
||||
AbilitySubject,
|
||||
} from '@/constants/abilityOption';
|
||||
|
||||
import { usePaymentReceivesListContext } from './PaymentReceiptsListProvider';
|
||||
import { useRefreshPaymentReceive } from '@/hooks/query/paymentReceives';
|
||||
import { useDownloadExportPdf } from '@/hooks/query/FinancialReports/use-export-pdf';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import { useResourceExportPdf } from '@/hooks/query/FinancialReports/use-export-pdf';
|
||||
|
||||
/**
|
||||
* Payment receives actions bar.
|
||||
@@ -62,9 +64,8 @@ function PaymentReceiveActionsBar({
|
||||
// Payment receives list context.
|
||||
const { paymentReceivesViews, fields } = usePaymentReceivesListContext();
|
||||
|
||||
// Exports the given resource into pdf.
|
||||
const { mutateAsync: exportPdf, isLoading: isExportPdfLoading } =
|
||||
useResourceExportPdf();
|
||||
// Exports pdf document.
|
||||
const { downloadAsync: downloadExportPdf } = useDownloadExportPdf();
|
||||
|
||||
// Handle new payment button click.
|
||||
const handleClickNewPaymentReceive = () => {
|
||||
@@ -98,7 +99,7 @@ function PaymentReceiveActionsBar({
|
||||
};
|
||||
// Handles the print button click.
|
||||
const handlePrintBtnClick = () => {
|
||||
exportPdf({ resource: 'PaymentReceive' });
|
||||
downloadExportPdf({ resource: 'PaymentReceive' });
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -147,7 +148,6 @@ function PaymentReceiveActionsBar({
|
||||
icon={<Icon icon={'print-16'} iconSize={'16'} />}
|
||||
text={<T id={'print'} />}
|
||||
onClick={handlePrintBtnClick}
|
||||
disabled={isExportPdfLoading}
|
||||
/>
|
||||
<Button
|
||||
className={Classes.MINIMAL}
|
||||
|
||||
Reference in New Issue
Block a user