import { Component } from '@angular/core'; import { NbSidebarService } from '@nebular/theme'; import { StateService } from '../../../@core/utils'; @Component({ selector: 'ngx-toggle-settings-button', styleUrls: ['./toggle-settings-button.component.scss'], template: ` `, }) export class ToggleSettingsButtonComponent { sidebarEnd = false; expanded = false; wasExpanded = false; constructor(private sidebarService: NbSidebarService, protected stateService: StateService) { this.stateService.onSidebarState() .subscribe(({id}) => { this.sidebarEnd = id === 'end'; }); } toggleSettings() { this.sidebarService.toggle(false, 'settings-sidebar'); this.expanded = !this.expanded; this.wasExpanded = true; } }