From a4b0e22ad89ea5cf4ed1321ebcc1b4bcf846ecc6 Mon Sep 17 00:00:00 2001 From: Aditya Chandel <8075870+adityachandelgit@users.noreply.github.com> Date: Tue, 2 Dec 2025 20:22:25 -0700 Subject: [PATCH] Visually indicate the active menu item in the left sidebar (#1738) --- .../layout-menu/app.menu.component.html | 8 +- .../layout-menu/app.menuitem.component.html | 32 ++++--- .../layout-menu/app.menuitem.component.scss | 84 +++++++++++++++++++ .../layout-menu/app.menuitem.component.ts | 6 +- 4 files changed, 108 insertions(+), 22 deletions(-) diff --git a/booklore-ui/src/app/shared/layout/component/layout-menu/app.menu.component.html b/booklore-ui/src/app/shared/layout/component/layout-menu/app.menu.component.html index fb4f88078..8ea7b8db8 100644 --- a/booklore-ui/src/app/shared/layout/component/layout-menu/app.menu.component.html +++ b/booklore-ui/src/app/shared/layout/component/layout-menu/app.menu.component.html @@ -4,7 +4,7 @@ @if (homeMenu$ | async; as homeMenu) { @for (item of homeMenu; track item; let i = $index) { @if (!item.separator) { -
  • +
  • } } } @@ -14,7 +14,7 @@ @if (libraryMenu$ | async; as libraryMenu) { @for (item of libraryMenu; track item; let i = $index) { @if (!item.separator) { -
  • +
  • } } } @@ -24,7 +24,7 @@ @if (shelfMenu$ | async; as shelfMenu) { @for (item of shelfMenu; track item; let i = $index) { @if (!item.separator) { -
  • +
  • } } } @@ -34,7 +34,7 @@ @if (magicShelfMenu$ | async; as shelfMenu) { @for (item of shelfMenu; track item; let i = $index) { @if (!item.separator) { -
  • +
  • } } } diff --git a/booklore-ui/src/app/shared/layout/component/layout-menu/app.menuitem.component.html b/booklore-ui/src/app/shared/layout/component/layout-menu/app.menuitem.component.html index 811c32790..c1f2db15e 100644 --- a/booklore-ui/src/app/shared/layout/component/layout-menu/app.menuitem.component.html +++ b/booklore-ui/src/app/shared/layout/component/layout-menu/app.menuitem.component.html @@ -1,13 +1,12 @@ @if (root) { @if (item.hasDropDown) { -
    -
    +
    +
    {{ item.label }}
    @if (item.hasCreate) { } @@ -17,14 +16,13 @@ [ngClass]="{ 'pi': true, 'pi-angle-up': isExpanded(key), - 'pi-angle-down': !isExpanded(key), - 'text-surface-500': true, - 'hover:text-surface-200': true, - 'pr-3': true - }"> + 'pi-angle-down': !isExpanded(key) + }" + class="expand-icon" + >
    } @else { -
    +
    {{ item.label }}
    } @@ -32,14 +30,15 @@
    @if ((item.routerLink && !item.items)) { - + {{ item.label }} } - + @if (item.type === 'Library' || item.type === 'Shelf' || item.type === 'magicShelfItem') { @if ((item.type !== 'Library' || (admin || canManipulateLibrary)) && item.label !== 'Unshelved' && item.label !== 'Kobo') { } } @if (item.type === 'Library' && (!admin && !canManipulateLibrary) || item.type === 'All Books' || item.label === 'Unshelved' || item.label === 'Kobo') { -

    +

    {{ (item.bookCount$ | async)?.toString() || '0' }}

    }
    -
    +