refactor(ui): replace SVG artwork placeholders with CSS (#292)
* chore(ui): replace SVG placeholders with CSS alternative * fix(ui): Placeholder review followup
This commit is contained in:
@@ -138,7 +138,11 @@
|
||||
<div class="settings-card book-group-card">
|
||||
<!-- Book Header -->
|
||||
<div class="book-group-header" role="button" tabindex="0" (click)="toggleGroup(group.bookId)" (keydown.enter)="toggleGroup(group.bookId)">
|
||||
<img [src]="group.thumbnailUrl" [alt]="group.bookTitle" class="book-thumbnail" />
|
||||
@if (group.thumbnailUrl) {
|
||||
<img [src]="group.thumbnailUrl" [alt]="group.bookTitle" class="book-thumbnail" />
|
||||
} @else {
|
||||
<app-cover-placeholder class="book-thumbnail" [title]="group.bookTitle" size="sm" />
|
||||
}
|
||||
<div class="book-info">
|
||||
<span class="book-title">{{ group.bookTitle }}</span>
|
||||
<span class="book-entry-count">
|
||||
|
||||
@@ -12,12 +12,13 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||
import {NotebookService} from '../../service/notebook.service';
|
||||
import {NotebookEntry, NotebookPage} from '../../model/notebook.model';
|
||||
import {UrlHelperService} from '../../../../shared/service/url-helper.service';
|
||||
import {CoverPlaceholderComponent} from '../../../../shared/components/cover-generator/cover-generator.component';
|
||||
import {PageTitleService} from '../../../../shared/service/page-title.service';
|
||||
|
||||
interface BookGroup {
|
||||
bookId: number;
|
||||
bookTitle: string;
|
||||
thumbnailUrl: string;
|
||||
thumbnailUrl: string | null;
|
||||
entries: NotebookEntry[];
|
||||
}
|
||||
|
||||
@@ -43,6 +44,7 @@ const EMPTY_PAGE: NotebookPage = {
|
||||
TooltipModule,
|
||||
Paginator,
|
||||
TranslocoDirective,
|
||||
CoverPlaceholderComponent,
|
||||
],
|
||||
templateUrl: './notebook.component.html',
|
||||
styleUrls: ['./notebook.component.scss'],
|
||||
@@ -184,7 +186,7 @@ export class NotebookComponent implements OnInit, OnDestroy {
|
||||
bookId: entry.bookId,
|
||||
bookTitle: entry.bookTitle,
|
||||
thumbnailUrl: isAudiobook
|
||||
? this.urlHelper.getAudiobookThumbnailUrl(entry.bookId)
|
||||
? this.urlHelper.getDirectAudiobookThumbnailUrl(entry.bookId)
|
||||
: this.urlHelper.getDirectThumbnailUrl(entry.bookId),
|
||||
entries: [],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user