From ae2294109b2ecc9b0188f0d1a28cfc51982d7380 Mon Sep 17 00:00:00 2001 From: "aditya.chandel" <> Date: Thu, 16 Jan 2025 21:01:10 -0700 Subject: [PATCH] Display notifications on hover over the button --- .../live-notification-box.component.ts | 2 +- .../layout-topbar/app.topbar.component.html | 33 ++++++++++++------- .../layout-topbar/app.topbar.component.ts | 10 ++++-- .../book-uploader.component.html | 8 ++--- .../book-uploader/book-uploader.component.ts | 28 ++++++++-------- 5 files changed, 49 insertions(+), 32 deletions(-) diff --git a/booklore-ui/src/app/core/component/live-notification-box/live-notification-box.component.ts b/booklore-ui/src/app/core/component/live-notification-box/live-notification-box.component.ts index 756f5dc97..d0c95088e 100644 --- a/booklore-ui/src/app/core/component/live-notification-box/live-notification-box.component.ts +++ b/booklore-ui/src/app/core/component/live-notification-box/live-notification-box.component.ts @@ -8,7 +8,7 @@ import {EventService} from '../../../shared/websocket/event.service'; templateUrl: './live-notification-box.component.html', styleUrl: './live-notification-box.component.scss', host: { - class: 'config-panel hidden' + class: 'config-panel' }, }) export class LiveNotificationBoxComponent { diff --git a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html index c20e5796e..0b0f772eb 100644 --- a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html +++ b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.html @@ -30,29 +30,40 @@
  • + pTooltip="Upload Book" tooltipPosition="top">
  • + pTooltip="Settings" tooltipPosition="top">
  • - -
  • - - +
  • - + +
  • - diff --git a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts index c75b6aa18..bb3eabd3b 100644 --- a/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts +++ b/booklore-ui/src/app/layout/component/layout-topbar/app.topbar.component.ts @@ -8,7 +8,7 @@ import {TooltipModule} from 'primeng/tooltip'; import {FormsModule} from '@angular/forms'; import {InputTextModule} from 'primeng/inputtext'; import {BookSearcherComponent} from '../../../book/components/book-searcher/book-searcher.component'; -import {NgClass} from '@angular/common'; +import {NgClass, NgIf} from '@angular/common'; import {EventService} from '../../../shared/websocket/event.service'; import {Button} from 'primeng/button'; import {StyleClass} from 'primeng/styleclass'; @@ -32,7 +32,8 @@ import {BookUploaderComponent} from '../../../utilities/component/book-uploader/ StyleClass, NgClass, Divider, - LiveNotificationBoxComponent + LiveNotificationBoxComponent, + NgIf ], }) export class AppTopBarComponent implements OnDestroy { @@ -55,6 +56,11 @@ export class AppTopBarComponent implements OnDestroy { } isMenuVisible: boolean = true; + isHovered: boolean = false; + + onHover(hovered: boolean): void { + this.isHovered = hovered; + } toggleMenu() { this.isMenuVisible = !this.isMenuVisible; diff --git a/booklore-ui/src/app/utilities/component/book-uploader/book-uploader.component.html b/booklore-ui/src/app/utilities/component/book-uploader/book-uploader.component.html index 399fd3f13..47efdd31d 100644 --- a/booklore-ui/src/app/utilities/component/book-uploader/book-uploader.component.html +++ b/booklore-ui/src/app/utilities/component/book-uploader/book-uploader.component.html @@ -2,20 +2,20 @@ *ngIf="(libraryState$ | async)?.libraries as libraries" class="flex flex-col gap-10 p-4 items-center justify-center min-w-[400px] max-w-[600px] w-full"> - + class="w-full"> - + class="w-full">