feat(ui): add enhanced user popover + rearrange sidebar (#1246)
Co-authored-by: brios <127139797+balazs-szucs@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import { LibraryShelfMenuService } from '../../../features/book/service/library-
|
||||
import { SortPref } from '../sidebar-sort-preferences';
|
||||
|
||||
import { SidebarLeaf, SidebarSection } from '../navigation/nav-item.model';
|
||||
import { buildHomeNavItems } from '../navigation/nav-catalog';
|
||||
import { buildHomeNavItems, findPageNavItem, ShellNavPermissions } from '../navigation/nav-catalog';
|
||||
|
||||
export interface HomeCounts {
|
||||
allBooks: number;
|
||||
@@ -60,6 +60,27 @@ export function buildHomeSection(translate: TranslateFn, counts: HomeCounts): Si
|
||||
}];
|
||||
}
|
||||
|
||||
export function buildToolsSection(
|
||||
translate: TranslateFn,
|
||||
permissions: ShellNavPermissions,
|
||||
): SidebarSection[] {
|
||||
const items = [
|
||||
findPageNavItem('libraryStats', translate, permissions),
|
||||
findPageNavItem('metadataManager', translate, permissions),
|
||||
findPageNavItem('bookdrop', translate, permissions),
|
||||
].filter((item): item is SidebarLeaf => !!item);
|
||||
|
||||
if (items.length === 0) return [];
|
||||
|
||||
return [{
|
||||
id: 'tools',
|
||||
menuKey: 'tools',
|
||||
label: translate('layout.menu.tools'),
|
||||
expandable: true,
|
||||
items,
|
||||
}];
|
||||
}
|
||||
|
||||
function homeItemBookCount(itemId: string, counts: HomeCounts): number | undefined {
|
||||
switch (itemId) {
|
||||
case 'allBooks': return counts.allBooks;
|
||||
|
||||
Reference in New Issue
Block a user