add mp with icons and update after review
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
} @else {
|
||||
<article class="object" [class.object--owned]="collected()">
|
||||
<header class="object__hero">
|
||||
<img class="object__hero-img" src="/assets/illustrations/object-hero.svg" alt="" />
|
||||
<img class="object__hero-img" [src]="item.background" alt="" />
|
||||
<button class="object__back" type="button" aria-label="Назад" (click)="goBack()">
|
||||
<app-icon name="chevron-left" [size]="22" />
|
||||
</button>
|
||||
@@ -36,6 +36,11 @@
|
||||
<p>{{ item.description }}</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Аудиогид</h2>
|
||||
<app-audio-guide [src]="item.audio" />
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Интересные факты</h2>
|
||||
<ol class="facts">
|
||||
@@ -67,25 +72,7 @@
|
||||
Этот объект уже в вашей коллекции. Повторно его получить нельзя.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<a class="object__map" routerLink="/map">
|
||||
<app-icon name="pin" [size]="20" />
|
||||
Показать на карте
|
||||
</a>
|
||||
} @else {
|
||||
<section>
|
||||
<h2>Примеры фото</h2>
|
||||
<div class="photos">
|
||||
@for (photo of photoExamples; track photo.label) {
|
||||
<figure>
|
||||
<img [src]="photo.src" [alt]="photo.label" />
|
||||
<span>{{ photo.label }}</span>
|
||||
</figure>
|
||||
}
|
||||
</div>
|
||||
<p class="object__hint">{{ item.photoHint }}</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Как забрать</h2>
|
||||
<ol class="steps">
|
||||
|
||||
@@ -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