import { ChangeDetectionStrategy , Component } from '@angular/core' ; import { ChannelsV2Service } from '../channels-v2.service' ; import { ConfigsService } from '../../../../common/services/configs.service' ; import { MindsUser } from '../../../../interfaces/entities' ; import entityToBannerUrl from '../../../../helpers/entity-to-banner-url' ; import { Session } from '../../../../services/session' ; @ Component ( { selector : 'm-channel__header' , changeDetection : ChangeDetectionStrategy . OnPush , templateUrl : 'header.component.html' , } ) export class ChannelHeaderComponent { /**
     * CDN URL
     */ readonly cdnUrl : string ; param service param configs constructor ( public service , configs , private session ) { this . cdnUrl = configs . get ( 'cdn_url' ) ; } param channel bannerBackgroundImageCss ( channel ) { const bannerUrl = entityToBannerUrl ( channel ) ; if ( ! bannerUrl ) { return { } ; } return { backgroundImage : `url(${ this . cdnUrl }${ bannerUrl })` , } ; } shouldShowSubscribesToYou ( channel ) { return ( channel . guid !== this . session . getLoggedInUser ( ) . guid && channel . subscriber ) ; } }