From 61d6a1de04a351d34702dc4ed9447f83265f5c01 Mon Sep 17 00:00:00 2001
From: "aditya.chandel" <>
Date: Tue, 21 Jan 2025 00:04:26 -0700
Subject: [PATCH] Better header icon setup
---
.../book-browser/book-browser.component.html | 30 +++++++++++---
.../book-browser/book-browser.component.scss | 41 +++++++++++++++++++
.../book-browser/book-browser.component.ts | 10 +++--
3 files changed, 71 insertions(+), 10 deletions(-)
diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.html b/booklore-ui/src/app/book/components/book-browser/book-browser.component.html
index a253db5e0..b9c44e335 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.html
+++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.html
@@ -17,7 +17,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
-
+ (click)="toggleTableGrid()"/>-->
-
+ tooltipPosition="top"/>-->
diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss b/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss
index 4fc692c01..6623ffb2e 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss
+++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.scss
@@ -66,3 +66,44 @@
pointer-events: none;
}
+.topbar-items {
+ display: flex;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ gap: 0.3rem;
+ align-items: center;
+
+ li {
+ position: relative;
+ }
+
+
+}
+
+.topbar-item {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ font-size: 1.5rem;
+ border: 1px solid var(--border-color);
+ width: 2.5rem;
+ height: 2.5rem;
+ transition: outline-color .2s, border-color .2s;
+ border-radius: 6px;
+ margin: 0;
+ padding: 0;
+ outline-color: transparent;
+ background-color: var(--card-background);
+ cursor: pointer;
+ &:hover {
+ border-color: var(--primary-color);
+ }
+
+ i, span {
+ color: var(--primary-color);
+ font-size: 1.25rem;
+ font-weight: 100;
+ }
+}
diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts
index b2f016960..5f849bd69 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts
+++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts
@@ -19,8 +19,8 @@ import {BookTableComponent} from './book-table/book-table.component';
import {animate, state, style, transition, trigger} from '@angular/animations';
import {MetadataFetchOptionsComponent} from '../../../metadata/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum';
-import {Button} from 'primeng/button';
-import {AsyncPipe, NgForOf, NgIf} from '@angular/common';
+import {Button, ButtonDirective, ButtonIcon} from 'primeng/button';
+import {AsyncPipe, NgClass, NgForOf, NgIf} from '@angular/common';
import {VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller';
import {BookCardComponent} from './book-card/book-card.component';
import {ProgressSpinner} from 'primeng/progressspinner';
@@ -30,6 +30,8 @@ import {InputText} from 'primeng/inputtext';
import {FormsModule} from '@angular/forms';
import {BookFilterComponent} from './book-filter/book-filter.component';
import {Tooltip} from 'primeng/tooltip';
+import {WindowMaximizeIcon} from 'primeng/icons';
+import {Ripple} from 'primeng/ripple';
export enum EntityType {
LIBRARY = 'Library',
@@ -42,7 +44,7 @@ export enum EntityType {
standalone: true,
templateUrl: './book-browser.component.html',
styleUrls: ['./book-browser.component.scss'],
- imports: [Button, NgIf, VirtualScrollerModule, BookCardComponent, AsyncPipe, ProgressSpinner, Select, Menu, NgForOf, InputText, FormsModule, BookTableComponent, BookFilterComponent, Tooltip],
+ imports: [Button, NgIf, VirtualScrollerModule, BookCardComponent, AsyncPipe, ProgressSpinner, Select, Menu, NgForOf, InputText, FormsModule, BookTableComponent, BookFilterComponent, Tooltip, ButtonDirective, WindowMaximizeIcon, ButtonIcon, Ripple, NgClass],
animations: [
trigger('slideInOut', [
state('void', style({
@@ -139,7 +141,7 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
}
get viewIcon(): string {
- return this.gridOrTable === 'grid' ? 'pi pi-table' : 'pi pi-objects-column';
+ return this.gridOrTable === 'grid' ? 'pi pi-objects-column' : 'pi pi-table';
}
private getEntityInfoFromRoute(): Observable<{ entityId: number; entityType: EntityType }> {