1- import { Component , EventEmitter , OnDestroy , OnInit , Output , ViewChild } from '@angular/core' ;
1+ import { Component , ElementRef , EventEmitter , OnDestroy , OnInit , Output , ViewChild } from '@angular/core' ;
2+ import { ActivatedRoute } from '@angular/router' ;
23import {
34 IButtonGroupEventArgs , IChangeSwitchEventArgs , IgxButtonGroupComponent ,
45 IgxSliderComponent , IgxToastComponent , ISliderValueChangeEventArgs , VerticalAlignment }
@@ -23,6 +24,8 @@ export class ControllerComponent implements OnInit, OnDestroy {
2324 @Output ( ) public playAction = new EventEmitter < { action : string } > ( ) ;
2425
2526 public volume = 1000 ;
27+ public theme = false ;
28+ public isThemeSwitchVisible = true ;
2629 public frequency = 500 ;
2730 public controls = [
2831 {
@@ -51,6 +54,8 @@ export class ControllerComponent implements OnInit, OnDestroy {
5154 private frequencyChanged$ : Observable < ISliderValueChangeEventArgs > ;
5255 private frequencyChangedSubscription : Subscription ;
5356
57+ constructor ( private router : ActivatedRoute , private elRef : ElementRef ) { }
58+
5459 public ngOnInit ( ) : void {
5560 this . volumeChanged$ = this . volumeSlider . valueChange . pipe ( debounce ( ( ) => timer ( 200 ) ) ) ;
5661 this . volumeChangedSubscription = this . volumeChanged$ . subscribe ( x => this . volumeChanged . emit ( this . volumeSlider . value as number ) ) ;
@@ -60,6 +65,11 @@ export class ControllerComponent implements OnInit, OnDestroy {
6065 . subscribe ( ( ) => this . frequencyChanged . emit ( this . intervalSlider . value as number ) ) ;
6166
6267 this . toast . positionSettings . verticalDirection = VerticalAlignment . Middle ;
68+
69+ // Hide theme switcher
70+ if ( this . router . snapshot . queryParamMap . get ( 'theme-switch' ) === 'false' ) {
71+ this . isThemeSwitchVisible = false ;
72+ }
6373 }
6474
6575 public ngOnDestroy ( ) : void {
0 commit comments