mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
BIG-5: add switching between compact and medium row size.
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
AdvancedFilterPopover,
|
||||
DashboardFilterButton,
|
||||
FormattedMessage as T,
|
||||
DashboardRowsHeightButton,
|
||||
} from 'components';
|
||||
|
||||
import { If, DashboardActionViewsList } from 'components';
|
||||
@@ -22,6 +23,9 @@ import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
|
||||
import withReceiptsActions from './withReceiptsActions';
|
||||
import withReceipts from './withReceipts';
|
||||
|
||||
import withSettingsActions from 'containers/Settings/withSettingsActions';
|
||||
import withSettings from 'containers/Settings/withSettings';
|
||||
|
||||
import { useReceiptsListContext } from './ReceiptsListProvider';
|
||||
import { useRefreshReceipts } from 'hooks/query/receipts';
|
||||
import { compose } from 'utils';
|
||||
@@ -35,6 +39,12 @@ function ReceiptActionsBar({
|
||||
|
||||
// #withReceipts
|
||||
receiptsFilterConditions,
|
||||
|
||||
// #withSettings
|
||||
receiptsTableSize,
|
||||
|
||||
// #withSettingsActions
|
||||
addSetting,
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
@@ -60,6 +70,11 @@ function ReceiptActionsBar({
|
||||
refresh();
|
||||
};
|
||||
|
||||
// Handle table row size change.
|
||||
const handleTableRowSizeChange = (size) => {
|
||||
addSetting('receipt', 'tableSize', size);
|
||||
};
|
||||
|
||||
return (
|
||||
<DashboardActionsBar>
|
||||
<NavbarGroup>
|
||||
@@ -117,6 +132,13 @@ function ReceiptActionsBar({
|
||||
icon={<Icon icon={'file-export-16'} iconSize={'16'} />}
|
||||
text={<T id={'export'} />}
|
||||
/>
|
||||
|
||||
<NavbarDivider />
|
||||
<DashboardRowsHeightButton
|
||||
initialValue={receiptsTableSize}
|
||||
onChange={handleTableRowSizeChange}
|
||||
/>
|
||||
<NavbarDivider />
|
||||
</NavbarGroup>
|
||||
<NavbarGroup align={Alignment.RIGHT}>
|
||||
<Button
|
||||
@@ -131,7 +153,11 @@ function ReceiptActionsBar({
|
||||
|
||||
export default compose(
|
||||
withReceiptsActions,
|
||||
withSettingsActions,
|
||||
withReceipts(({ receiptTableState }) => ({
|
||||
receiptsFilterConditions: receiptTableState.filterRoles,
|
||||
})),
|
||||
withSettings(({ receiptSettings }) => ({
|
||||
receiptsTableSize: receiptSettings?.tableSize,
|
||||
})),
|
||||
)(ReceiptActionsBar);
|
||||
|
||||
Reference in New Issue
Block a user