Add fm-thumbnail component
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<div class="thumbnail">
|
||||
<img *ngIf="item.thumbnail" class="card-img-top" [src]="getThumbnailUrl(item)" />
|
||||
<div *ngIf="!item.thumbnail" class="big-icon" [style.background-color]="itemTypeService.getColor(item.itemType)">
|
||||
<i [ngClass]="itemTypeService.getIcon(item.itemType)"></i>
|
||||
</div>
|
||||
</div>
|
@@ -0,0 +1,22 @@
|
||||
import { Component,Input } from '@angular/core';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { IItem } from '../../models/item';
|
||||
import { commonReducers,ItemTypeService } from '../../../public-api'
|
||||
|
||||
@Component({
|
||||
selector: 'fm-thumbnail',
|
||||
templateUrl: 'thumbnail.component.html',
|
||||
styleUrls: ['thumbnail.component.scss']
|
||||
})
|
||||
|
||||
|
||||
export class ThumbnailComponent {
|
||||
@Input() public item: IItem;
|
||||
|
||||
constructor(public store: Store<commonReducers.State>, public itemTypeService: ItemTypeService) {
|
||||
}
|
||||
|
||||
getThumbnailUrl(item:IItem):string {
|
||||
return item.url+'/thumbnail?v=' + Date.parse(item.updated);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user