diff --git a/client/src/components/DialogsContainer.js b/client/src/components/DialogsContainer.js
index a9aa24ff0..19d8e021b 100644
--- a/client/src/components/DialogsContainer.js
+++ b/client/src/components/DialogsContainer.js
@@ -15,6 +15,8 @@ import QuickPaymentReceiveFormDialog from 'containers/Dialogs/QuickPaymentReceiv
import QuickPaymentMadeFormDialog from 'containers/Dialogs/QuickPaymentMadeFormDialog';
import AllocateLandedCostDialog from 'containers/Dialogs/AllocateLandedCostDialog';
import InvoicePdfPreviewDialog from 'containers/Dialogs/InvoicePdfPreviewDialog';
+import EstimatePdfPreviewDialog from 'containers/Dialogs/EstimatePdfPreviewDialog';
+import ReceiptPdfPreviewDialog from '../containers/Dialogs/ReceiptPdfPreviewDialog';
/**
* Dialogs container.
@@ -35,7 +37,9 @@ export default function DialogsContainer() {
-
+
+
+
);
}
diff --git a/client/src/components/DrawersContainer.js b/client/src/components/DrawersContainer.js
index 723fbfeab..acc556105 100644
--- a/client/src/components/DrawersContainer.js
+++ b/client/src/components/DrawersContainer.js
@@ -11,6 +11,7 @@ import InvoiceDetailDrawer from 'containers/Drawers/InvoiceDetailDrawer';
import ReceiptDetailDrawer from 'containers/Drawers/ReceiptDetailDrawer';
import PaymentReceiveDetailDrawer from 'containers/Drawers/PaymentReceiveDetailDrawer';
import PaymentMadeDetailDrawer from 'containers/Drawers/PaymentMadeDetailDrawer';
+import EstimateDetailDrawer from '../containers/Drawers/EstimateDetailDrawer';
export default function DrawersContainer() {
return (
@@ -24,6 +25,7 @@ export default function DrawersContainer() {
+
diff --git a/client/src/containers/Dialogs/EstimatePdfPreviewDialog/EstimatePdfPreviewDialogContent.js b/client/src/containers/Dialogs/EstimatePdfPreviewDialog/EstimatePdfPreviewDialogContent.js
new file mode 100644
index 000000000..f242d198b
--- /dev/null
+++ b/client/src/containers/Dialogs/EstimatePdfPreviewDialog/EstimatePdfPreviewDialogContent.js
@@ -0,0 +1,50 @@
+import React from 'react';
+import { AnchorButton } from '@blueprintjs/core';
+
+import { DialogContent, PdfDocumentPreview, T } from 'components';
+import { usePdfEstimate } from 'hooks/query';
+
+import withDialogActions from 'containers/Dialog/withDialogActions';
+import { compose } from 'utils';
+
+function EstimatePdfPreviewDialogContent({
+ subscriptionForm: { estimateId },
+ dialogName,
+ // #withDialogActions
+ closeDialog,
+}) {
+ const { isLoading, pdfUrl } = usePdfEstimate(estimateId);
+
+ return (
+
+
+
+
+
+ );
+}
+
+export default compose(withDialogActions)(EstimatePdfPreviewDialogContent);
diff --git a/client/src/containers/Dialogs/EstimatePdfPreviewDialog/index.js b/client/src/containers/Dialogs/EstimatePdfPreviewDialog/index.js
new file mode 100644
index 000000000..1646222e9
--- /dev/null
+++ b/client/src/containers/Dialogs/EstimatePdfPreviewDialog/index.js
@@ -0,0 +1,44 @@
+import React from 'react';
+import classNames from 'classnames';
+
+import { T, Dialog, DialogSuspense } from 'components';
+import { CLASSES } from 'common/classes';
+
+import withDialogRedux from 'components/DialogReduxConnect';
+
+import { compose } from 'utils';
+
+// Lazy loading the content.
+const PdfPreviewDialogContent = React.lazy(() =>
+ import('./EstimatePdfPreviewDialogContent'),
+);
+
+/**
+ * Estimate PDF preview dialog.
+ */
+function EstimatePdfPreviewDialog({
+ dialogName,
+ payload = { estimateId: null },
+ isOpen,
+}) {
+ return (
+ }
+ className={classNames(CLASSES.DIALOG_PDF_PREVIEW)}
+ autoFocus={true}
+ canEscapeKeyClose={true}
+ isOpen={isOpen}
+ style={{ width: '1000px' }}
+ >
+
+
+
+
+ );
+}
+
+export default compose(withDialogRedux())(EstimatePdfPreviewDialog);
diff --git a/client/src/containers/Dialogs/InvoicePdfPreviewDialog/InvoicePdfPreviewDialogContent.js b/client/src/containers/Dialogs/InvoicePdfPreviewDialog/InvoicePdfPreviewDialogContent.js
index 3dfe4e3fa..04d37e66f 100644
--- a/client/src/containers/Dialogs/InvoicePdfPreviewDialog/InvoicePdfPreviewDialogContent.js
+++ b/client/src/containers/Dialogs/InvoicePdfPreviewDialog/InvoicePdfPreviewDialogContent.js
@@ -8,17 +8,18 @@ import withDialogActions from 'containers/Dialog/withDialogActions';
import { compose } from 'utils';
function InvoicePdfPreviewDialogContent({
+ subscriptionForm: { invoiceId },
// #withDialog
closeDialog,
}) {
- const { isLoading, pdfUrl } = usePdfInvoice(1);
+ const { isLoading, pdfUrl } = usePdfInvoice(invoiceId);
return (