Skip to content

Commit

Permalink
fix(footer): remove unused logic for setting max toolbar items
Browse files Browse the repository at this point in the history
  • Loading branch information
micaelagoffe committed Dec 12, 2024
1 parent a5d796c commit 0c5e68c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
3 changes: 0 additions & 3 deletions lib/render-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ import { saveAsCsvAction } from './save-as-csv-action';
import { saveAsXlsxAction } from './save-as-xlsx-action';
import { isEmpty } from '@neovici/cosmoz-utils/template';

// eslint-disable-next-line max-lines-per-function
export const renderFooter = ({
columns,
selectedItems,
csvFilename,
xlsxFilename,
xlsxSheetname,
topPlacement,
maxToolbarItems,
}) =>
html`<cosmoz-bottom-bar
id="bottomBar"
?active=${!isEmpty(selectedItems.length)}
?max-toolbar-items=${!isEmpty(maxToolbarItems)}
>
<slot name="info" slot="info">
${ngettext(
Expand Down
2 changes: 0 additions & 2 deletions lib/use-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ export const useFooter = ({ host, ...rest }) => {
xlsxFilename = 'omnitable.xlsx',
xlsxSheetname = 'Omnitable',
topPlacement = _defaultPlacement,
maxToolbarItems,
} = host;

return {
csvFilename,
xlsxFilename,
xlsxSheetname,
topPlacement,
maxToolbarItems,
...rest,
};
};
3 changes: 0 additions & 3 deletions lib/use-omnitable.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { useHeader } from './use-header';
import { useList } from './use-list';
import { useFooter } from './use-footer';

// eslint-disable-next-line max-lines-per-function
export const useOmnitable = (host) => {
const {
hashParam,
Expand Down Expand Up @@ -48,7 +47,6 @@ export const useOmnitable = (host) => {
resizeSpeedFactor,
sortAndGroupOptions,
}),
maxToolbarItems = isMini ? '0' : undefined,
dataIsValid = data && Array.isArray(data) && data.length > 0,
[selectedItems, setSelectedItems] = useState([]);

Expand Down Expand Up @@ -96,7 +94,6 @@ export const useOmnitable = (host) => {
host,
selectedItems,
columns,
maxToolbarItems,
}),
};
};

0 comments on commit 0c5e68c

Please sign in to comment.