Polish business FA layout and wire special-group keys plus SSL sync.
RTL carousels/FABs, special key+title fields, slider gallery fixes, and dashboard SSL sync agent for super-admin. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
66004a0fba
commit
672091d1f5
@@ -111,22 +111,28 @@ export function formatBlogAuthor(author: BlogAuthor | null): string {
|
||||
return name || author.email || 'Unknown author'
|
||||
}
|
||||
|
||||
export function formatBlogDate(value: string | null): string {
|
||||
export function formatBlogDate(
|
||||
value: string | null,
|
||||
locale: 'en' | 'fa' = 'en',
|
||||
): string {
|
||||
if (!value) return '—'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
return date.toLocaleDateString('en-US', {
|
||||
return date.toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
})
|
||||
}
|
||||
|
||||
export function formatBlogCardDate(value: string | null): string {
|
||||
if (!value) return 'Not published'
|
||||
export function formatBlogCardDate(
|
||||
value: string | null,
|
||||
locale: 'en' | 'fa' = 'en',
|
||||
): string {
|
||||
if (!value) return locale === 'fa' ? 'منتشر نشده' : 'Not published'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
return date.toLocaleDateString('en-US', {
|
||||
return date.toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
|
||||
@@ -50,8 +50,8 @@ export function mapExpertReviewApiToUi(review: ExpertReviewApi): ProductExpertRe
|
||||
}
|
||||
}
|
||||
|
||||
export function formatReviewDate(iso: string): string {
|
||||
return new Date(iso).toLocaleDateString('en-US', {
|
||||
export function formatReviewDate(iso: string, locale: 'en' | 'fa' = 'en'): string {
|
||||
return new Date(iso).toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
|
||||
@@ -113,22 +113,28 @@ export function mapPortfolioApiToUi(portfolio: PortfolioApi): Portfolio {
|
||||
}
|
||||
}
|
||||
|
||||
export function formatPortfolioCardDate(value: string | null): string {
|
||||
if (!value) return 'Not published'
|
||||
export function formatPortfolioCardDate(
|
||||
value: string | null,
|
||||
locale: 'en' | 'fa' = 'en',
|
||||
): string {
|
||||
if (!value) return locale === 'fa' ? 'منتشر نشده' : 'Not published'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
return date.toLocaleDateString('en-US', {
|
||||
return date.toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})
|
||||
}
|
||||
|
||||
export function formatPortfolioDate(value: string | null): string {
|
||||
export function formatPortfolioDate(
|
||||
value: string | null,
|
||||
locale: 'en' | 'fa' = 'en',
|
||||
): string {
|
||||
if (!value) return '—'
|
||||
const date = new Date(value)
|
||||
if (Number.isNaN(date.getTime())) return value
|
||||
return date.toLocaleDateString('en-US', {
|
||||
return date.toLocaleDateString(locale === 'fa' ? 'fa-IR' : 'en-US', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
|
||||
@@ -15,6 +15,7 @@ export interface ProductApi {
|
||||
status: 'draft' | 'published' | 'archived'
|
||||
categoryId: string | null
|
||||
categoryName: string
|
||||
categoryNameFa?: string
|
||||
brandId: string | null
|
||||
brand: {
|
||||
id: string
|
||||
@@ -84,6 +85,7 @@ export function mapProductApiToUi(product: ProductApi): Product {
|
||||
nameFa: product.nameFa,
|
||||
categoryId: product.categoryId ?? '',
|
||||
category: product.categoryName,
|
||||
categoryFa: product.categoryNameFa || '',
|
||||
summary: product.summary,
|
||||
description: product.descriptionHtml,
|
||||
image: product.image || product.thumbnail || '',
|
||||
|
||||
@@ -10,6 +10,7 @@ export interface StoreSpecialsListResponse {
|
||||
}
|
||||
|
||||
export interface CreateStoreSpecialPayload {
|
||||
key: string
|
||||
title: string
|
||||
storeItemIds?: string[]
|
||||
sortOrder?: number
|
||||
@@ -17,6 +18,7 @@ export interface CreateStoreSpecialPayload {
|
||||
}
|
||||
|
||||
export interface UpdateStoreSpecialPayload {
|
||||
key?: string
|
||||
title?: string
|
||||
storeItemIds?: string[]
|
||||
sortOrder?: number
|
||||
|
||||
Reference in New Issue
Block a user