show component

This commit is contained in:
2020-03-08 09:45:05 +01:00
committed by smuddy
parent d68cd590ad
commit bb0676a428
53 changed files with 344 additions and 185 deletions

View File

@@ -0,0 +1,4 @@
<div class="list-item">
<div>{{show.date.toDate()|date:'dd.MM.yyyy'}}</div>
<div>{{show.showType|showType}}</div>
</div>

View File

@@ -0,0 +1,26 @@
@import "../../../../../styles/styles";
.list-item {
padding: 5px 20px;
display: grid;
grid-template-columns: 1fr 2fr;
min-height: 34px;
& > div {
display: flex;
align-items: center;
}
cursor: pointer;
&:hover {
background: @primary-color;
color: #fff;
}
}
.number {
font-size: 18px;
font-weight: bold;
text-align: right;
}

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ListItemComponent} from './list-item.component';
describe('ListItemComponent', () => {
let component: ListItemComponent;
let fixture: ComponentFixture<ListItemComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ListItemComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListItemComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,18 @@
import {Component, Input, OnInit} from '@angular/core';
import {Show} from '../../services/show';
@Component({
selector: 'app-list-item',
templateUrl: './list-item.component.html',
styleUrls: ['./list-item.component.less']
})
export class ListItemComponent implements OnInit {
@Input() public show: Show;
constructor() {
}
ngOnInit() {
}
}

View File

@@ -0,0 +1,7 @@
<div>
<app-list-header></app-list-header>
<app-card *ngIf="shows$ | async as shows" [@fade] [padding]="false">
<app-list-item *ngFor="let show of shows" [routerLink]="show.id" [show]="show"></app-list-item>
</app-card>
</div>

View File

@@ -0,0 +1,25 @@
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {ListComponent} from './list.component';
describe('ListComponent', () => {
let component: ListComponent;
let fixture: ComponentFixture<ListComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ListComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ListComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,20 @@
import {Component} from '@angular/core';
import {Observable} from 'rxjs';
import {Show} from '../services/show';
import {ShowDataService} from '../services/show-data.service';
import {fade} from '../../../animations';
@Component({
selector: 'app-list',
templateUrl: './list.component.html',
styleUrls: ['./list.component.less'],
animations: [fade]
})
export class ListComponent {
public shows$: Observable<Show[]>;
constructor(showDataService: ShowDataService) {
this.shows$ = showDataService.list$();
}
}