BC-17 feat: customer/vendor drawer of readonly details.

This commit is contained in:
a.bouhuolia
2021-09-09 11:56:06 +02:00
parent 6fd47aa884
commit 7b968a43ef
24 changed files with 738 additions and 25 deletions

View File

@@ -18,13 +18,18 @@ export function DetailsMenu({
children,
direction = DIRECTION.VERTICAL,
minLabelSize,
className,
}) {
return (
<div
className={classNames('details-menu', {
'details-menu--vertical': direction === DIRECTION.VERTICAL,
'details-menu--horizantal': direction === DIRECTION.HORIZANTAL,
})}
className={classNames(
'details-menu',
{
'details-menu--vertical': direction === DIRECTION.VERTICAL,
'details-menu--horizantal': direction === DIRECTION.HORIZANTAL,
},
className,
)}
>
<DetailsMenuContext.Provider value={{ minLabelSize }}>
{children}
@@ -36,14 +41,18 @@ export function DetailsMenu({
/**
* Detail item.
*/
export function DetailItem({ label, children, name }) {
export function DetailItem({ label, children, name, className }) {
const { minLabelSize } = useDetailsMenuContext();
return (
<div
className={classNames('detail-item', {
[`detail-item--${name}`]: name,
})}
className={classNames(
'detail-item',
{
[`detail-item--${name}`]: name,
},
className,
)}
>
<div
style={{

View File

@@ -1,8 +1,5 @@
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 AccountDrawer from 'containers/Drawers/AccountDrawer';
import ManualJournalDrawer from 'containers/Drawers/ManualJournalDrawer';
import ExpenseDrawer from 'containers/Drawers/ExpenseDrawer';
@@ -13,7 +10,8 @@ import PaymentReceiveDetailDrawer from 'containers/Drawers/PaymentReceiveDetailD
import PaymentMadeDetailDrawer from 'containers/Drawers/PaymentMadeDetailDrawer';
import EstimateDetailDrawer from '../containers/Drawers/EstimateDetailDrawer';
import ItemDetailDrawer from '../containers/Drawers/ItemDetailDrawer';
import ContactDetailDrawer from '../containers/Drawers/ContactDetailDrawer';
import CustomerDetailsDrawer from '../containers/Drawers/CustomerDetailsDrawer';
import VendorDetailsDrawer from '../containers/Drawers/VendorDetailsDrawer';
import InventoryAdjustmentDetailDrawer from '../containers/Drawers/InventoryAdjustmentDetailDrawer';
import { DRAWERS } from 'common/drawers';
@@ -34,7 +32,8 @@ export default function DrawersContainer() {
<PaymentReceiveDetailDrawer name={'payment-receive-detail-drawer'} />
<PaymentMadeDetailDrawer name={'payment-made-detail-drawer'} />
<ItemDetailDrawer name={'item-detail-drawer'} />
<ContactDetailDrawer name={'contact-detail-drawer'} />
<CustomerDetailsDrawer name={'customer-details-drawer'} />
<VendorDetailsDrawer name={'vendor-details-drawer'} />
<InventoryAdjustmentDetailDrawer
name={DRAWERS.INVENTORY_ADJUSTMENT_DRAWER}
/>