fix(portal): remove redundant catalog type badges

This commit is contained in:
4gray committed 2026-07-20 21:24:30 +02:00
1 parent ddce93f32f
commit 571f790362
3 files changed
+15 -43

No files matched your search

@@ -106,35 +106,6 @@ mat-card:hover {
}
}
// ─── Type badge ──────────────────────────────────────────────────────────────
.type-badge {
position: absolute;
top: 6px;
left: 6px;
z-index: 1;
padding: 3px 6px;
border-radius: 5px;
font-size: 0.58rem;
font-weight: 700;
line-height: 1;
text-transform: uppercase;
letter-spacing: 0.04em;
background: rgba(0, 0, 0, 0.85);
color: #fff;
&.live {
color: #ef5350;
}
&.movie {
color: #42a5f5;
}
&.series {
color: #66bb6a;
}
}
// ─── Rating badge ─────────────────────────────────────────────────────────────
.rating {
position: absolute;
@@ -59,7 +59,7 @@ describe('GridListComponent', () => {
fixture = TestBed.createComponent(GridListComponent);
});
it('renders live logo cards with stream icons and a live badge', () => {
it('renders live logo cards with stream icons', () => {
fixture.componentRef.setInput('items', [
{
name: 'Live Channel',
@@ -73,16 +73,27 @@ describe('GridListComponent', () => {
const card = fixture.debugElement.query(By.css('mat-card'));
const image = fixture.debugElement.query(By.css('.stream-icon'));
const badge = fixture.debugElement.query(By.css('.type-badge'));
expect(card.nativeElement.classList).toContain('grid-card--logo');
expect(image.nativeElement.getAttribute('src')).toBe(
'channel-logo.png'
);
expect(badge.nativeElement.classList).toContain('live');
expect(badge.nativeElement.textContent.trim()).toBe('live');
});
it.each(['live', 'vod', 'series'] as const)(
'does not render a redundant %s type badge in homogeneous grids',
(type) => {
fixture.componentRef.setInput('items', [
{ name: 'Catalog item', stream_icon: 'catalog-item.png' },
]);
fixture.componentRef.setInput('type', type);
fixture.detectChanges();
expect(
fixture.debugElement.query(By.css('.type-badge'))
).toBeNull();
}
);
it('renders the live placeholder for logo cards without artwork', () => {
fixture.componentRef.setInput('items', [
{
@@ -106,16 +106,6 @@ function normalizeArtworkUrl(value: string | undefined): string | undefined {
>
@let poster = resolvePoster(i);
<div class="card-thumbnail-container">
@if (type()) {
<div
class="type-badge"
[class.live]="type() === 'live'"
[class.movie]="type() === 'vod'"
[class.series]="type() === 'series'"
>
{{ type() }}
</div>
}
@if (poster && !hasArtworkFailed(poster)) {
<img
class="stream-icon"