cleanup: remove tenant variant logic and enforce config-driven UI
This commit is contained in:
@@ -179,7 +179,9 @@ export class ApiService {
|
||||
private resolveImageUrl(url: string): string {
|
||||
if (!url) return '';
|
||||
if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith('/')) return url;
|
||||
const origin = `https://${environment.domain}`;
|
||||
const origin = typeof window !== 'undefined'
|
||||
? window.location.origin
|
||||
: '';
|
||||
if (url.startsWith('./')) return `${origin}/${url.slice(2)}`;
|
||||
return `${origin}/${url}`;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Injectable, signal, computed, effect, Injector } from '@angular/core';
|
||||
import { DeliveryOption, CartItem } from '../models';
|
||||
import { getDiscountedPrice } from '../utils/item.utils';
|
||||
import { normalizeDeliveryOption, normalizeOptionalNumber } from '../utils/normalization.utils';
|
||||
import { environment } from '../../environments/environment';
|
||||
import type { } from '../types/telegram.types';
|
||||
|
||||
type CartVariant = { colour?: string; size?: string; price?: number; currency?: string };
|
||||
@@ -11,7 +10,7 @@ type CartVariant = { colour?: string; size?: string; price?: number; currency?:
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CartService {
|
||||
private readonly STORAGE_KEY = `${environment.brandName.toLowerCase().replace(/\s+/g, '_')}_cart`;
|
||||
private readonly STORAGE_KEY = 'marketplace_cart';
|
||||
private cartItems = signal<CartItem[]>([]);
|
||||
private isTelegram = typeof window !== 'undefined' && !!window.Telegram?.WebApp;
|
||||
private addingItems = new Set<number>();
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
export interface Language {
|
||||
code: string;
|
||||
@@ -20,8 +19,7 @@ export interface Currency {
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class LanguageService {
|
||||
// @ts-ignore
|
||||
private currentLanguageSignal = signal<string>(environment.defaultLanguage || 'ru');
|
||||
private currentLanguageSignal = signal<string>('ru');
|
||||
private currentCurrencySignal = signal<string>('RUB');
|
||||
|
||||
languages: Language[] = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Injectable, inject, DOCUMENT } from '@angular/core';
|
||||
import { Meta, Title } from '@angular/platform-browser';
|
||||
import { environment } from '../../environments/environment';
|
||||
import { Item } from '../models';
|
||||
import { getDiscountedPrice, getMainImage } from '../utils/item.utils';
|
||||
import { UiRuntimeFacade } from '../facades/runtime/ui-runtime.facade';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -11,9 +11,15 @@ export class SeoService {
|
||||
private meta = inject(Meta);
|
||||
private title = inject(Title);
|
||||
private doc = inject(DOCUMENT);
|
||||
private readonly uiRuntime = inject(UiRuntimeFacade);
|
||||
|
||||
private readonly siteUrl = `https://${environment.domain}`;
|
||||
private readonly siteName = environment.brandFullName;
|
||||
private get siteUrl(): string {
|
||||
return this.doc?.location?.origin ?? '';
|
||||
}
|
||||
|
||||
private get siteName(): string {
|
||||
return this.uiRuntime.marketplaceDisplayName() || 'Marketplace';
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Open Graph & Twitter Card meta tags for a product/item page.
|
||||
|
||||
Reference in New Issue
Block a user