2026-07-10 13:43:53 +04:00
|
|
|
import { Component, ChangeDetectionStrategy, effect, inject, signal } from '@angular/core';
|
2026-07-05 03:37:35 +04:00
|
|
|
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';
|
2026-07-03 01:58:08 +04:00
|
|
|
import { UiRuntimeFacade } from '../../facades/runtime/ui-runtime.facade';
|
2026-07-05 03:37:35 +04:00
|
|
|
import { LangRoutePipe } from '../../pipes/lang-route.pipe';
|
2026-07-05 04:17:31 +04:00
|
|
|
import { FooterPaymentIcon, FooterResolvedGroup, FooterResolverService } from '../../core/config/footer-resolver.service';
|
2026-07-10 13:43:53 +04:00
|
|
|
import { ConfigService } from '../../core/config/config.service';
|
2026-01-18 18:57:06 +04:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-footer',
|
2026-07-05 03:37:35 +04:00
|
|
|
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 {
|
2026-07-05 03:37:35 +04:00
|
|
|
readonly footerGroups = signal<FooterResolvedGroup[]>([]);
|
2026-07-05 04:17:31 +04:00
|
|
|
readonly paymentIcons = signal<FooterPaymentIcon[]>([]);
|
|
|
|
|
readonly copyrightText = signal('');
|
2026-07-05 03:37:35 +04:00
|
|
|
|
2026-07-10 13:43:53 +04:00
|
|
|
private readonly configService = inject(ConfigService);
|
|
|
|
|
|
2026-07-05 03:37:35 +04:00
|
|
|
constructor(
|
|
|
|
|
private readonly uiRuntime: UiRuntimeFacade,
|
2026-07-05 04:17:31 +04:00
|
|
|
private readonly footerResolver: FooterResolverService
|
2026-07-05 03:37:35 +04:00
|
|
|
) {
|
2026-07-10 13:43:53 +04:00
|
|
|
effect(() => {
|
|
|
|
|
this.configService.bootstrapRevision();
|
|
|
|
|
const bootstrap = this.configService.getBootstrapSnapshot();
|
|
|
|
|
if (!bootstrap) {
|
2026-07-05 03:37:35 +04:00
|
|
|
this.footerGroups.set([]);
|
2026-07-05 04:17:31 +04:00
|
|
|
this.paymentIcons.set([]);
|
|
|
|
|
this.copyrightText.set('');
|
2026-07-10 13:43:53 +04:00
|
|
|
return;
|
2026-07-05 03:37:35 +04:00
|
|
|
}
|
2026-07-10 13:43:53 +04:00
|
|
|
|
|
|
|
|
const model = this.footerResolver.resolveFooterModelFromBootstrap(bootstrap);
|
|
|
|
|
this.footerGroups.set(model.groups);
|
|
|
|
|
this.paymentIcons.set(model.paymentIcons);
|
|
|
|
|
this.copyrightText.set(model.copyrightText);
|
2026-07-05 03:37:35 +04:00
|
|
|
});
|
2026-07-10 13:43:53 +04:00
|
|
|
|
|
|
|
|
this.configService.loadBootstrap().subscribe();
|
2026-07-05 03:37:35 +04:00
|
|
|
}
|
2026-07-03 01:58:08 +04:00
|
|
|
|
2026-01-18 18:57:06 +04:00
|
|
|
currentYear = new Date().getFullYear();
|
2026-07-03 01:58:08 +04:00
|
|
|
|
|
|
|
|
get brandName(): string {
|
2026-07-05 00:38:21 +04:00
|
|
|
return this.uiRuntime.marketplaceName();
|
2026-07-03 01:58:08 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get contactEmail(): string {
|
|
|
|
|
return this.uiRuntime.contactEmail();
|
|
|
|
|
}
|
2026-01-18 18:57:06 +04:00
|
|
|
}
|