Files
marketplaces/src/app/components/footer/footer.component.ts

50 lines
1.7 KiB
TypeScript
Raw Normal View History

import { Component, ChangeDetectionStrategy, signal } from '@angular/core';
import { take } from 'rxjs/operators';
import { RouterLink } from '@angular/router';
2026-02-26 23:09:20 +04:00
import { TranslatePipe } from '../../i18n/translate.pipe';
2026-07-02 02:22:00 +04:00
import { LogoComponent } from '../logo/logo.component';
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service';
2026-01-18 18:57:06 +04:00
@Component({
selector: 'app-footer',
imports: [TranslatePipe, LogoComponent, RouterLink, LangRoutePipe],
2026-01-18 18:57:06 +04:00
templateUrl: './footer.component.html',
2026-02-19 01:23:25 +04:00
styleUrls: ['./footer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
2026-01-18 18:57:06 +04:00
})
export class FooterComponent {
readonly footerGroups = signal<FooterResolvedGroup[]>([]);
readonly paymentIcons = signal<FooterPaymentIcon[]>([]);
readonly copyrightText = signal('');
constructor(
private readonly uiRuntime: UiRuntimeFacade,
private readonly footerResolver: FooterResolverService
) {
this.footerResolver.resolveFooterModel().pipe(take(1)).subscribe({
next: model => {
this.footerGroups.set(model.groups);
this.paymentIcons.set(model.paymentIcons);
this.copyrightText.set(model.copyrightText);
},
error: () => {
this.footerGroups.set([]);
this.paymentIcons.set([]);
this.copyrightText.set('');
}
});
}
2026-01-18 18:57:06 +04:00
currentYear = new Date().getFullYear();
get brandName(): string {
2026-07-05 00:38:21 +04:00
return this.uiRuntime.marketplaceName();
}
get contactEmail(): string {
return this.uiRuntime.contactEmail();
}
2026-01-18 18:57:06 +04:00
}