1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-02-09 07:41:33 +02:00
parent c134d322a9
commit 62f9172403

View File

@ -342,17 +342,16 @@ export class ItemListLayout extends React.Component<ItemListLayoutProps> {
const allItemsCount = this.props.store.getTotalCount();
const itemsCount = items.length;
const isFiltered = isReady && filters.length > 0;
const RefreshIcon = <Icon material="update" small={true} onClick={() => this.loadStores()} />;
if (isFiltered) {
const toggleFilters = () => userSettings.showAppliedFilters = !userSettings.showAppliedFilters;
return (
<><a onClick={toggleFilters}>Filtered</a>: {itemsCount} / {allItemsCount} {RefreshIcon}</>
<><a onClick={toggleFilters}>Filtered</a>: {itemsCount} / {allItemsCount}</>
);
}
return allItemsCount <= 1 ? <>{allItemsCount} item {RefreshIcon}</> : <>{allItemsCount} items {RefreshIcon}</>;
return allItemsCount <= 1 ? `${allItemsCount} item` : `${allItemsCount} items`;
}
renderHeader() {