From 5abf007de742dc79214d6c85260c0d58e02007b7 Mon Sep 17 00:00:00 2001 From: "a.bouhuolia" Date: Wed, 25 Aug 2021 20:42:25 +0200 Subject: [PATCH] feat: style payment receive and made details drawers. --- client/src/components/DrawersContainer.js | 6 +- .../Drawers/BillDrawer/BillDetailHeader.js | 2 +- .../EstimateDetailHeader.js | 2 +- .../InvoiceDetailHeader.js | 3 +- .../PaymentMadeDetailActionsBar.js | 24 +++---- .../PaymentMadeDetailContent.js | 4 +- .../PaymentMadeDetailFooter.js | 36 ++++++---- .../PaymentMadeDetailHeader.js | 66 +++++++++-------- .../PaymentMadeDetailTab.js | 21 ++++-- .../PaymentMadeDetailTable.js | 13 +++- .../PaymentMadeDetails.js | 18 +++-- .../PaymentMadeDrawer.module.scss | 53 ++++++++++++++ .../Drawers/PaymentMadeDetailDrawer/index.js | 7 +- .../Drawers/PaymentMadeDetailDrawer/utils.js | 7 +- .../PaymentReceiveActionsBar.js | 23 +++--- .../PaymentReceiveDetail.js | 19 +++-- .../PaymentReceiveDetailContent.js | 7 +- .../PaymentReceiveDetailFooter.js | 35 +++++---- .../PaymentReceiveDetailHeader.js | 72 ++++++++++--------- .../PaymentReceiveDetailProvider.js | 15 ++-- .../PaymentReceiveDetailTab.js | 18 ++--- .../PaymentReceiveDetailTable.js | 18 ++++- .../PaymentReceiveDrawer.module.scss | 53 ++++++++++++++ .../PaymentReceiveDetailDrawer/index.js | 7 +- .../PaymentReceiveDetailDrawer/utils.js | 71 ++++++++++-------- .../ReceiptDetailHeader.js | 2 +- .../PaymentMadeUniversalSearch.js | 1 + .../PaymentReceiveUniversalSearch.js | 5 +- .../PaymentReceiveActionsBar.js | 2 - client/src/lang/en/index.json | 7 +- .../Drawers/InvoiceDrawer.module.scss | 1 - 31 files changed, 389 insertions(+), 229 deletions(-) create mode 100644 client/src/containers/Drawers/PaymentMadeDetailDrawer/PaymentMadeDrawer.module.scss create mode 100644 client/src/containers/Drawers/PaymentReceiveDetailDrawer/PaymentReceiveDrawer.module.scss diff --git a/client/src/components/DrawersContainer.js b/client/src/components/DrawersContainer.js index e56988bcb..ea5010e6b 100644 --- a/client/src/components/DrawersContainer.js +++ b/client/src/components/DrawersContainer.js @@ -2,7 +2,7 @@ import React from 'react'; // import EstimateDrawer from 'containers/Sales/Estimates/EstimateDetails/EstimateDrawer'; // import InvoiceDrawer from 'containers/Sales/Invoices/InvoiceDetails/InvoiceDrawer'; // import ReceiptDrawer from 'containers/Sales/Receipts/ReceiptDetails/ReceiptDrawer'; -import PaymentReceiveDrawer from 'containers/Sales/PaymentReceives/PaymentDetails/PaymentReceiveDrawer'; +// import PaymentReceiveDrawer from 'containers/Sales/PaymentReceives/PaymentDetails/PaymentReceiveDrawer'; import AccountDrawer from 'containers/Drawers/AccountDrawer'; import ManualJournalDrawer from 'containers/Drawers/ManualJournalDrawer'; import ExpenseDrawer from 'containers/Drawers/ExpenseDrawer'; @@ -23,10 +23,6 @@ import { DRAWERS } from 'common/drawers'; export default function DrawersContainer() { return (
- {/* */} - {/* */} - {/* */} - diff --git a/client/src/containers/Drawers/BillDrawer/BillDetailHeader.js b/client/src/containers/Drawers/BillDrawer/BillDetailHeader.js index 96af60a59..57a488087 100644 --- a/client/src/containers/Drawers/BillDrawer/BillDetailHeader.js +++ b/client/src/containers/Drawers/BillDrawer/BillDetailHeader.js @@ -22,7 +22,7 @@ export default function BillDetailHeader() { children={

{bill.formatted_amount}

} /> {estimate.formatted_amount} - - + { - return paymentMadeId - ? (history.push(`/payment-mades/${paymentMadeId}/edit`), - closeDrawer('payment-made-detail-drawer')) - : null; + const handleEditPaymentMade = () => { + history.push(`/payment-mades/${paymentMadeId}/edit`); + closeDrawer('payment-made-detail-drawer'); }; // Handle delete payment made. - const onDeletePaymentMade = () => { - return paymentMadeId - ? (openAlert('payment-made-delete', { paymentMadeId }), - closeDrawer('payment-made-detail-drawer')) - : null; + const handleDeletePaymentMade = () => { + openAlert('payment-made-delete', { paymentMadeId }); }; return ( @@ -54,7 +52,7 @@ function PaymentMadeDetailActionsBar({ className={Classes.MINIMAL} icon={} text={} - onClick={safeCallback(onEditPaymentMade)} + onClick={handleEditPaymentMade} />