diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 6b2892f..af118b2 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -13,8 +13,8 @@ export const routes: Routes = [ { path: 'collections', component: CollectionsPage }, { path: 'city', component: CityPage }, { path: 'collection', pathMatch: 'full', redirectTo: '/city' }, - { path: 'items/:id/icon', component: IconPreviewPage }, - { path: 'items/:id', component: MapItemPage }, - { path: 'objects/:id', redirectTo: 'items/:id' }, + { path: 'city/:id/icon', component: IconPreviewPage }, + { path: 'city/:id', component: MapItemPage }, + { path: 'objects/:id', redirectTo: 'city/:id' }, { path: '**', redirectTo: '' }, ]; diff --git a/src/app/app.ts b/src/app/app.ts index 9793fc5..df49ed0 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -24,7 +24,5 @@ export class App { { initialValue: this.router.url }, ); - protected readonly hideNav = computed( - () => this.url().startsWith('/items') || this.url().startsWith('/objects'), - ); + protected readonly hideNav = computed(() => this.url().startsWith('/city/')); } diff --git a/src/app/pages/city-page/city-page.ts b/src/app/pages/city-page/city-page.ts index 7699e95..ecd425c 100644 --- a/src/app/pages/city-page/city-page.ts +++ b/src/app/pages/city-page/city-page.ts @@ -28,9 +28,7 @@ export class CityPage { protected readonly collectedIds = this.store.selectSignal(selectCollectedIdSet); protected readonly openedCount = this.store.selectSignal(selectOpenedCount); protected readonly progress = this.store.selectSignal(selectProgress); - protected readonly closedCount = computed( - () => this.city.objects.length - this.openedCount(), - ); + protected readonly closedCount = computed(() => this.city.objects.length - this.openedCount()); protected readonly landmarks = computed(() => { const items = this.city.objects; const ids = this.collectedIds(); @@ -70,6 +68,6 @@ export class CityPage { } protected objectRoute(id: string): string[] { - return this.collectedIds().has(id) ? ['/items', id, 'icon'] : ['/items', id]; + return this.collectedIds().has(id) ? ['/city', id, 'icon'] : ['/city', id]; } } diff --git a/src/app/pages/collections-page/collections-page.ts b/src/app/pages/collections-page/collections-page.ts index 89e9eb8..1d2f69a 100644 --- a/src/app/pages/collections-page/collections-page.ts +++ b/src/app/pages/collections-page/collections-page.ts @@ -1,4 +1,10 @@ -import { afterNextRender, ChangeDetectionStrategy, Component, computed, inject } from '@angular/core'; +import { + afterNextRender, + ChangeDetectionStrategy, + Component, + computed, + inject, +} from '@angular/core'; import { RouterLink } from '@angular/router'; import { Store } from '@ngrx/store'; @@ -6,7 +12,12 @@ import { AuthPromptService } from '../../auth/auth-prompt.service'; import { AuthService } from '../../auth/auth.service'; import { CityCatalogService } from '../../root/services/city-catalog.service'; import { Icon } from '../../shared/icon/icon'; -import { selectCollectedIdSet, selectOpenedCount, selectProfile, selectProgress } from '../../state'; +import { + selectCollectedIdSet, + selectOpenedCount, + selectProfile, + selectProgress, +} from '../../state'; @Component({ selector: 'app-collections-page', @@ -45,7 +56,7 @@ export class CollectionsPage { ); protected objectRoute(id: string): string[] { - return this.collectedIds().has(id) ? ['/items', id, 'icon'] : ['/items', id]; + return this.collectedIds().has(id) ? ['/city', id, 'icon'] : ['/city', id]; } protected logout(): void { diff --git a/src/app/pages/icon-preview-page/icon-preview-page.ts b/src/app/pages/icon-preview-page/icon-preview-page.ts index a0d33f6..54b8d89 100644 --- a/src/app/pages/icon-preview-page/icon-preview-page.ts +++ b/src/app/pages/icon-preview-page/icon-preview-page.ts @@ -35,7 +35,7 @@ export class IconPreviewPage { return; } - void this.router.navigate(['/items', item.id], { replaceUrl: true }); + void this.router.navigate(['/city', item.id], { replaceUrl: true }); }); } }