Remove individual spinners from dashboard page
This commit is contained in:
+3
-7
@@ -1,17 +1,13 @@
|
|||||||
<p class="dashboard-scroller-title">{{ title }}</p>
|
<p class="dashboard-scroller-title">{{ title }}</p>
|
||||||
|
|
||||||
<div *ngIf="isLoading">
|
<div class="dashboard-scroller-no-books" *ngIf="!books || books.length === 0">
|
||||||
<p-progressSpinner></p-progressSpinner>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="dashboard-scroller-no-books" *ngIf="!isLoading && (!books || books.length === 0)">
|
|
||||||
<p class="text-sm">
|
<p class="text-sm">
|
||||||
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="dashboard-scroller-infinite"
|
<div class="dashboard-scroller-infinite"
|
||||||
*ngIf="!isLoading && books"
|
*ngIf="books"
|
||||||
infiniteScroll
|
infiniteScroll
|
||||||
[infiniteScrollDistance]="2"
|
[infiniteScrollDistance]="2"
|
||||||
[infiniteScrollThrottle]="50"
|
[infiniteScrollThrottle]="50"
|
||||||
@@ -24,6 +20,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!isLoading && books === null">
|
<div *ngIf=" books === null">
|
||||||
<p class="text-sm">Failed to load books! :(</p>
|
<p class="text-sm">Failed to load books! :(</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-15
@@ -18,7 +18,7 @@ import {Book} from '../../../book/model/book.model';
|
|||||||
],
|
],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class DashboardScrollerComponent implements OnInit, OnChanges {
|
export class DashboardScrollerComponent {
|
||||||
|
|
||||||
@Input() bookListType: 'lastRead' | null = null;
|
@Input() bookListType: 'lastRead' | null = null;
|
||||||
@Input() title: string = 'Last Read Books';
|
@Input() title: string = 'Last Read Books';
|
||||||
@@ -26,18 +26,4 @@ export class DashboardScrollerComponent implements OnInit, OnChanges {
|
|||||||
|
|
||||||
@ViewChild('scrollContainer') scrollContainer!: ElementRef;
|
@ViewChild('scrollContainer') scrollContainer!: ElementRef;
|
||||||
|
|
||||||
|
|
||||||
isLoading = true;
|
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
if (this.books !== undefined) {
|
|
||||||
this.isLoading = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnChanges(): void {
|
|
||||||
if (this.books !== undefined) {
|
|
||||||
this.isLoading = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user