Add theme selector

This commit is contained in:
aditya.chandel
2024-12-16 21:53:25 -07:00
parent 696649a24f
commit 61e9580409
13 changed files with 144 additions and 21 deletions
@@ -76,7 +76,7 @@ export class BookMetadataComponent implements OnInit, OnDestroy {
openEditDialog(bookId: number | undefined, libraryId: number | undefined) {
this.dialogRef = this.dialogService.open(BooksMetadataDialogComponent, {
header: 'Metadata: Google Books',
modal: false,
modal: true,
width: '65%',
height: '85%',
data: {
@@ -1,5 +1,6 @@
<div class="dashboard">
<div *ngIf="isLibrariesEmpty; else dashboardScroller">
<div class="dashboard-no-library" *ngIf="isLibrariesEmpty; else dashboardScroller">
<h1 class="no-library-header">
Looks like you haven't added a library yet. Let's add one!
</h1>
@@ -12,6 +12,10 @@
color: var(--text-color);
}
.dashboard-no-library {
margin-top: 3rem;
}
.dashboard .p-dialog {
max-width: 90%;
}
@@ -10,12 +10,12 @@ import {DashboardScrollerComponent} from '../dashboard-scroller/dashboard-scroll
@Component({
selector: 'app-home-page',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.scss'],
imports: [
Button,
NgIf,
DashboardScrollerComponent
],
styleUrls: ['./dashboard.component.scss'],
providers: [DialogService],
})
export class DashboardComponent {
@@ -30,10 +30,9 @@
<i class="pi pi-upload"></i>
<span>Profile</span>
</button>
<button class="p-link layout-topbar-button" [routerLink]="'/documentation'">
<i class="pi pi-cog"></i>
<span>Settings</span>
</button>
<app-notification></app-notification>
<div class="top-bar-app-theme-switcher">
<app-theme-switcher></app-theme-switcher>
</div>
</div>
</div>
@@ -4,6 +4,7 @@ import {LayoutService} from './service/app.layout.service';
import {RouterLink} from '@angular/router';
import {DialogService as PrimeDialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
import {LibraryCreatorComponent} from '../library-creator/library-creator.component';
import {ThemeSwitcherComponent} from '../../../theme-switcher/theme-switcher.component';
import {TooltipModule} from 'primeng/tooltip';
import {FormsModule} from '@angular/forms';
import {InputTextModule} from 'primeng/inputtext';
@@ -19,7 +20,8 @@ import {FileUploadComponent} from '../file-upload/file-upload.component';
FormsModule,
InputTextModule,
SearchComponent,
NotificationComponent
NotificationComponent,
ThemeSwitcherComponent
],
templateUrl: './app.topbar.component.html',
})
@@ -37,9 +39,20 @@ export class AppTopBarComponent implements OnDestroy {
openLibraryCreatorDialog(): void {
this.ref = this.dialogService.open(LibraryCreatorComponent, {
header: 'Create New Library',
modal: false,
modal: true,
width: '50%',
height: '50%',
style: {bottom: '15%'}
});
}
openFileUploadDialog() {
this.ref = this.dialogService.open(FileUploadComponent, {
header: 'Upload Book',
modal: true,
width: '45%',
height: '40%',
style: {bottom: '20%'}
});
}
@@ -48,14 +61,4 @@ export class AppTopBarComponent implements OnDestroy {
this.ref.close();
}
}
openFileUploadDialog() {
this.ref = this.dialogService.open(FileUploadComponent, {
header: 'Upload Book',
modal: false,
width: '45%',
height: '40%',
style: { bottom: '20%' }
});
}
}
@@ -29,7 +29,7 @@ export class LibraryCreatorComponent {
show() {
this.ref = this.dialogService.open(DirectoryPickerComponent, {
header: 'Select Media Directory',
modal: false,
modal: true,
width: '50%',
height: '75%',
contentStyle: {overflow: 'auto'},