Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 125x 34x 34x 34x 34x 34x 45x 43x 45x 43x 9x 3x 3x 2x 11x 11x | import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { TabsModule } from 'primeng/tabs';
import { ThemeBuilderComponent } from '../theme-builder/theme-builder.component';
import { GraphTheme } from '../../models/colorSetting';
import { TwinpadApiService } from '../../services/twinpad-api.service';
import { ThemesListComponent } from '../themes-list/themes-list.component';
@Component({
selector: 'app-themes',
imports: [TabsModule, ThemeBuilderComponent, ThemesListComponent, ],
templateUrl: './themes.component.html',
styleUrl: './themes.component.scss'
})
export class ThemesComponent implements OnInit {
@Output() themesChangedEvent = new EventEmitter();
libraryThemes: GraphTheme[];
marketplaceThemes: GraphTheme[];
selectedTab: number = 0;
activeGraphTheme: GraphTheme;
editMode: boolean = false;
constructor(private twinpadApiService: TwinpadApiService) {}
ngOnInit(): void {
this.updateThemesLists();
}
updateThemesLists() {
this.twinpadApiService.getFavoriteGraphThemes().subscribe({
next: graphThemes => {
this.libraryThemes = graphThemes.items;
}
});
this.twinpadApiService.getGraphThemes().subscribe({
next: graphThemes => {
this.marketplaceThemes = graphThemes.items;
}
});
}
editTheme(themeId: string) {
this.activeGraphTheme = this.libraryThemes.find(theme => theme.id === themeId) ?? new GraphTheme();
this.editMode = true;
this.selectedTab = 2;
}
cancelEdit() {
this.editMode = false;
}
handleThemesChanged() {
this.themesChangedEvent.emit();
this.updateThemesLists();
}
}
|