refactoring(receipt drawer): receipt drawer.

This commit is contained in:
elforjani3
2021-03-06 20:36:36 +02:00
parent 252f3b4617
commit 51059bc277
6 changed files with 95 additions and 23 deletions

View File

@@ -65,10 +65,10 @@ function ReceiptsDataTable({
openAlert('receipt-close', { receiptId: receipt.id });
};
// Handle drawer receipts.
const handleDrawerReceipt = () => {
openDrawer('receipt-drawer', {});
};
// Handle drawer receipts.
const handleDrawerReceipt = ({ id }) => {
openDrawer('receipt-drawer', { receiptId: id });
};
// Handles the datable fetch data once the state changing.
const handleDataTableFetchData = useCallback(
@@ -111,7 +111,7 @@ function ReceiptsDataTable({
onEdit: handleEditReceipt,
onDelete: handleDeleteReceipt,
onClose: handleCloseReceipt,
onDrawer:handleDrawerReceipt,
onDrawer: handleDrawerReceipt,
baseCurrency,
}}
/>