BiG-5: Complete, add switch small and medium table row size.

This commit is contained in:
elforjani13
2021-09-26 21:02:53 +02:00
parent fcace4213c
commit 71f9fa47d4
45 changed files with 337 additions and 196 deletions

View File

@@ -72,7 +72,7 @@ function ReceiptActionsBar({
// Handle table row size change.
const handleTableRowSizeChange = (size) => {
addSetting('receipt', 'tableSize', size);
addSetting('salesReceipts', 'tableSize', size);
};
return (

View File

@@ -14,6 +14,7 @@ import withDrawerActions from 'containers/Drawer/withDrawerActions';
import withDialogActions from 'containers/Dialog/withDialogActions';
import withReceipts from './withReceipts';
import withReceiptsActions from './withReceiptsActions';
import withSettings from '../../../Settings/withSettings';
import { useReceiptsListContext } from './ReceiptsListProvider';
import { useReceiptsTableColumns, ActionsMenu } from './components';
@@ -37,6 +38,9 @@ function ReceiptsDataTable({
// #withDialogAction
openDialog,
// #withSettings
receiptsTableSize,
}) {
const history = useHistory();
@@ -125,6 +129,7 @@ function ReceiptsDataTable({
onCellClick={handleCellClick}
initialColumnsWidths={initialColumnsWidths}
onColumnResizing={handleColumnResizing}
size={receiptsTableSize}
payload={{
onEdit: handleEditReceipt,
onDelete: handleDeleteReceipt,
@@ -145,4 +150,7 @@ export default compose(
withReceipts(({ receiptTableState }) => ({
receiptTableState,
})),
withSettings(({ receiptSettings }) => ({
receiptsTableSize: receiptSettings?.tableSize,
})),
)(ReceiptsDataTable);