Add fm-thumbnail component
This commit is contained in:
parent
3f6863845b
commit
d134240b8b
@ -33,6 +33,7 @@ import { MenuBackgroundComponent } from './components/menu-background/menu-backg
|
|||||||
import { HasPackageDirective} from './components/has-package/has-package.directive';
|
import { HasPackageDirective} from './components/has-package/has-package.directive';
|
||||||
import { HasClaimDirective} from './components/has-claim/has-claim.directive';
|
import { HasClaimDirective} from './components/has-claim/has-claim.directive';
|
||||||
import { UserMenuComponent} from './components/user-menu/user-menu.component';
|
import { UserMenuComponent} from './components/user-menu/user-menu.component';
|
||||||
|
import { ThumbnailComponent } from './components/thumbnail/thumbnail.component';
|
||||||
import { Alert } from './enumerations/alert.enum';
|
import { Alert } from './enumerations/alert.enum';
|
||||||
import { IEventMessage } from './models/event.message';
|
import { IEventMessage } from './models/event.message';
|
||||||
import { IItem, Item } from './models/item';
|
import { IItem, Item } from './models/item';
|
||||||
@ -71,6 +72,7 @@ export {
|
|||||||
TimespanComponent,
|
TimespanComponent,
|
||||||
TagInputComponent,
|
TagInputComponent,
|
||||||
UserMenuComponent,
|
UserMenuComponent,
|
||||||
|
ThumbnailComponent,
|
||||||
HasPackageDirective,
|
HasPackageDirective,
|
||||||
HasClaimDirective,
|
HasClaimDirective,
|
||||||
Alert,
|
Alert,
|
||||||
@ -133,7 +135,8 @@ export {
|
|||||||
GradientSelectComponent,
|
GradientSelectComponent,
|
||||||
AppMenuComponent,
|
AppMenuComponent,
|
||||||
NotificationMenuComponent,
|
NotificationMenuComponent,
|
||||||
BackButtonComponent
|
BackButtonComponent,
|
||||||
|
ThumbnailComponent
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
NgbModule,
|
NgbModule,
|
||||||
@ -156,7 +159,8 @@ export {
|
|||||||
UserMenuComponent,
|
UserMenuComponent,
|
||||||
GradientComponent,
|
GradientComponent,
|
||||||
GradientSelectComponent,
|
GradientSelectComponent,
|
||||||
BackButtonComponent
|
BackButtonComponent,
|
||||||
|
ThumbnailComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class AppCommonModule {
|
export class AppCommonModule {
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user