add pages
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { MatProgressBar } from '@angular/material/progress-bar';
|
||||
import { RouterLink } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
import { selectCollectedIdSet, selectOpenedCount, selectProgress } from '../../state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-cities-page',
|
||||
imports: [RouterLink, MatButton, MatProgressBar, Icon],
|
||||
templateUrl: './cities-page.html',
|
||||
styleUrl: './cities-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class CitiesPage {
|
||||
private readonly catalog = inject(CityCatalogService);
|
||||
private readonly store = inject(Store);
|
||||
|
||||
protected readonly city = this.catalog.city;
|
||||
protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet);
|
||||
protected readonly openedCount = this.store.selectSignal(selectOpenedCount);
|
||||
protected readonly totalCount = this.city.objects.length;
|
||||
protected readonly progress = this.store.selectSignal(selectProgress);
|
||||
}
|
||||
Reference in New Issue
Block a user