arch(sprint1): move UI env reads behind runtime facade
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import { ApiService, LanguageService } from '../../services';
|
||||
import { Category } from '../../models';
|
||||
import { environment } from '../../../environments/environment';
|
||||
import { getTranslatedCategoryName } from '../../utils/item.utils';
|
||||
import { ItemsCarouselComponent } from '../../components/items-carousel/items-carousel.component';
|
||||
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
||||
import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -16,8 +16,13 @@ import { TranslatePipe } from '../../i18n/translate.pipe';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class HomeComponent implements OnInit, OnDestroy {
|
||||
brandName = environment.brandFullName;
|
||||
isnovo = environment.theme === 'novo';
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
private router: Router,
|
||||
private langService: LanguageService,
|
||||
private readonly uiRuntime: UiRuntimeFacade
|
||||
) {}
|
||||
|
||||
categories = signal<Category[]>([]);
|
||||
wideCategories = signal<Set<number>>(new Set());
|
||||
loading = signal(true);
|
||||
@@ -53,7 +58,13 @@ export class HomeComponent implements OnInit, OnDestroy {
|
||||
return cache;
|
||||
});
|
||||
|
||||
constructor(private apiService: ApiService, private router: Router, private langService: LanguageService) {}
|
||||
get brandName(): string {
|
||||
return this.uiRuntime.brandFullName();
|
||||
}
|
||||
|
||||
get isnovo(): boolean {
|
||||
return this.uiRuntime.isNovo();
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadCategories();
|
||||
|
||||
Reference in New Issue
Block a user