11import { Component , EventEmitter , OnDestroy , OnInit , Output , ViewChild } from '@angular/core' ;
2+ import { ActivatedRoute } from '@angular/router' ;
23import {
34 IButtonGroupEventArgs , IChangeSwitchEventArgs , IgxButtonGroupComponent ,
45 IgxSliderComponent , IgxToastComponent , ISliderValueChangeEventArgs , VerticalAlignment }
@@ -24,6 +25,7 @@ export class ControllerComponent implements OnInit, OnDestroy {
2425
2526 public volume = 1000 ;
2627 public theme = false ;
28+ public isThemeSwitchVisible = true ;
2729 public frequency = 500 ;
2830 public controls = [
2931 {
@@ -52,6 +54,8 @@ export class ControllerComponent implements OnInit, OnDestroy {
5254 private frequencyChanged$ : Observable < ISliderValueChangeEventArgs > ;
5355 private frequencyChangedSubscription : Subscription ;
5456
57+ constructor ( private router : ActivatedRoute ) { }
58+
5559 public ngOnInit ( ) : void {
5660 this . volumeChanged$ = this . volumeSlider . valueChange . pipe ( debounce ( ( ) => timer ( 200 ) ) ) ;
5761 this . volumeChangedSubscription = this . volumeChanged$ . subscribe ( x => this . volumeChanged . emit ( this . volumeSlider . value as number ) ) ;
@@ -61,6 +65,11 @@ export class ControllerComponent implements OnInit, OnDestroy {
6165 . subscribe ( ( ) => this . frequencyChanged . emit ( this . intervalSlider . value as number ) ) ;
6266
6367 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+ }
6473 }
6574
6675 public ngOnDestroy ( ) : void {
0 commit comments