Add a Torob toggle in store settings and show parent category on product chips.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
fde6a34e44
commit
8c187b18be
@@ -7,6 +7,7 @@ import { ProductDetailsTabs } from '../components/ProductDetailsTabs'
|
||||
import { useT } from '../i18n/useT'
|
||||
import { ApiError } from '../lib/api'
|
||||
import {
|
||||
formatProductCategoryChip,
|
||||
getProduct,
|
||||
mapProductApiToUi,
|
||||
} from '../services/productService'
|
||||
@@ -101,7 +102,8 @@ export function ProductDetailsPage() {
|
||||
const descriptionLocale = textLocaleAttrs(
|
||||
product.description?.replace(/<[^>]+>/g, ' ') ?? '',
|
||||
)
|
||||
const categoryLocale = textLocaleAttrs(product.category)
|
||||
const categoryLabel = formatProductCategoryChip(product, isFa)
|
||||
const categoryLocale = textLocaleAttrs(categoryLabel)
|
||||
|
||||
return (
|
||||
<main className={pageStyles.content}>
|
||||
@@ -154,15 +156,15 @@ export function ProductDetailsPage() {
|
||||
</div>
|
||||
|
||||
<div className={styles.details}>
|
||||
{product.category && (
|
||||
{categoryLabel ? (
|
||||
<span
|
||||
className={[styles.categoryChip, categoryLocale.className].filter(Boolean).join(' ')}
|
||||
lang={categoryLocale.lang}
|
||||
dir={categoryLocale.dir}
|
||||
dir={isFa ? 'rtl' : 'ltr'}
|
||||
>
|
||||
{product.category}
|
||||
{categoryLabel}
|
||||
</span>
|
||||
)}
|
||||
) : null}
|
||||
|
||||
<h1
|
||||
className={[styles.nameEn, primaryLocale.className].filter(Boolean).join(' ')}
|
||||
|
||||
Reference in New Issue
Block a user