add mp with icons and update after review
This commit is contained in:
@@ -1,11 +1,21 @@
|
||||
import { Location } from '@angular/common';
|
||||
import { ChangeDetectionStrategy, Component, computed, HostListener, inject, input, signal } from '@angular/core';
|
||||
import { Router, RouterLink } from '@angular/router';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
computed,
|
||||
HostListener,
|
||||
inject,
|
||||
input,
|
||||
signal,
|
||||
} from '@angular/core';
|
||||
import { MatButton } from '@angular/material/button';
|
||||
import { Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
|
||||
import { AuthPromptService } from '../../auth/auth-prompt.service';
|
||||
import { ClaimFlow } from '../../claim/claim-flow/claim-flow';
|
||||
import { CityCatalogService } from '../../root/services/city-catalog.service';
|
||||
import { AudioGuide } from '../../shared/audio-guide/audio-guide';
|
||||
import { Icon } from '../../shared/icon/icon';
|
||||
import {
|
||||
GorodarActions,
|
||||
@@ -17,7 +27,7 @@ import {
|
||||
|
||||
@Component({
|
||||
selector: 'app-map-item-page',
|
||||
imports: [MatButton, Icon, ClaimFlow, RouterLink],
|
||||
imports: [MatButton, Icon, ClaimFlow, AudioGuide],
|
||||
templateUrl: './map-item-page.html',
|
||||
styleUrl: './map-item-page.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
@@ -27,6 +37,7 @@ export class MapItemPage {
|
||||
private readonly store = inject(Store);
|
||||
private readonly location = inject(Location);
|
||||
private readonly router = inject(Router);
|
||||
private readonly authPrompt = inject(AuthPromptService);
|
||||
|
||||
readonly id = input.required<string>();
|
||||
|
||||
@@ -72,11 +83,6 @@ export class MapItemPage {
|
||||
return claim.landmarkId === this.id() && claim.stage !== 'idle';
|
||||
});
|
||||
|
||||
protected readonly photoExamples = [
|
||||
{ label: 'Днём', src: '/assets/illustrations/photo-day.svg' },
|
||||
{ label: 'Вечером', src: '/assets/illustrations/photo-evening.svg' },
|
||||
{ label: 'Зимой', src: '/assets/illustrations/photo-winter.svg' },
|
||||
];
|
||||
protected readonly photoOpen = signal(false);
|
||||
|
||||
protected goBack(): void {
|
||||
@@ -85,11 +91,17 @@ export class MapItemPage {
|
||||
return;
|
||||
}
|
||||
|
||||
void this.router.navigateByUrl('/map');
|
||||
void this.router.navigateByUrl('/city');
|
||||
}
|
||||
|
||||
protected claimItem(): void {
|
||||
this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
|
||||
void this.authPrompt.prompt('claim').then((result) => {
|
||||
if (result !== 'authenticated') {
|
||||
return;
|
||||
}
|
||||
|
||||
this.store.dispatch(GorodarActions.takePhoto({ landmarkId: this.id() }));
|
||||
});
|
||||
}
|
||||
|
||||
protected openPhoto(): void {
|
||||
|
||||
Reference in New Issue
Block a user