import { ChangeDetectionStrategy , ChangeDetectorRef , Component , Input , } from '@angular/core' ; import { BehaviorSubject } from 'rxjs' ; import { AbstractSubscriberComponent } from '../../../common/components/abstract-subscriber/abstract-subscriber.component' ; import { ConfigsService } from '../../../common/services/configs.service' ; import { ThemeService } from '../../../common/services/theme.service' ; /**
 * A bar containing media coverage on various blockchain platforms.
 */ @ Component ( { selector : 'm-marketing__asFeaturedInBlockchain' , changeDetection : ChangeDetectionStrategy . OnPush , templateUrl : 'as-featured-in-blockchain.component.html' , styleUrls : [ './as-featured-in-blockchain.component.ng.scss' ] , } ) export class MarketingAsFeaturedInBlockchainComponent extends AbstractSubscriberComponent { @ Input ( ) inThePress : boolean = false ; readonly cdnAssetsUrl : string ; constructor ( private themeService , private cd , configs ) { super ( ) ; this . cdnAssetsUrl = configs . get ( 'cdn_assets_url' ) ; } ngOnInit ( ) { this . subscriptions . push ( this . isDarkMode$ . subscribe ( isDarkMode => this . detectChanges ( ) ) ) ; } returns { Observable < boolean } get isDarkMode$ ( ) : BehaviorSubject < boolean > { return this . themeService . isDark$ ; } returns { string } get coinDeskLogoSrc ( ) { return this . isDarkMode$ . getValue ( ) ? `${ this . cdnAssetsUrl }assets/marketing/coindesk-wide-light.png` : `${ this . cdnAssetsUrl }assets/marketing/coindesk-wide-dark.png` ; } returns { string } get coinTelegraphLogoSrc ( ) { return this . isDarkMode$ . getValue ( ) ? `${ this . cdnAssetsUrl }assets/marketing/coin-telegraph-light.png` : `${ this . cdnAssetsUrl }assets/marketing/coin-telegraph-dark.png` ; } returns { string } get decryptLogoSrc ( ) { return this . isDarkMode$ . getValue ( ) ? `${ this . cdnAssetsUrl }assets/marketing/decrypt-light.png` : `${ this . cdnAssetsUrl }assets/marketing/decrypt-dark.png` ; } returns { string } get bitcoinDotComLogoSrc ( ) : string { return this . isDarkMode$ . getValue ( ) ? `${ this . cdnAssetsUrl }assets/marketing/bitcoin-com-dark.png` : `${ this . cdnAssetsUrl }assets/marketing/bitcoin-com-light.png` ; } detectChanges ( ) { this . cd . markForCheck ( ) ; this . cd . detectChanges ( ) ; } }