From 7bc4ca137e02f84726532a6a07d9da7b5729accc Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Wed, 15 Jul 2026 12:11:16 +0330 Subject: [PATCH] fix: refine FeaturedProducts layout, remove shield icon, position tag independently, enlarge product image, and display full first sentence in description --- .../application/components/FeaturedProducts.tsx | 17 +++++++++-------- .../application/lib/services/productService.ts | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/application/components/FeaturedProducts.tsx b/frontend/application/components/FeaturedProducts.tsx index 0ff178f1..c6e59625 100644 --- a/frontend/application/components/FeaturedProducts.tsx +++ b/frontend/application/components/FeaturedProducts.tsx @@ -36,6 +36,11 @@ function ProductCard({ product, onClick }: { product: Product; key?: string | nu transition={{ duration: 0.5 }} className="group bg-white rounded-3xl border border-medical-gray-200 overflow-hidden hover:shadow-2xl hover:shadow-canina-blue/10 transition-all duration-500 flex flex-col h-full cursor-pointer relative" > + {/* Independent Category Tag at the absolute top-right of the card */} +
+ {product.category} +
+ {compatibility && (
)} {/* Product Image Area */} -
+
-
- {product.category} -
{/* Main PDP Link */} @@ -86,11 +88,10 @@ function ProductCard({ product, onClick }: { product: Product; key?: string | nu {/* Content Area */}
router.push(`/shop/${product.slug || product.id}`)}> -
-

+
+

{product.name}

-

diff --git a/frontend/application/lib/services/productService.ts b/frontend/application/lib/services/productService.ts index aa2f3d39..2ffbd7aa 100644 --- a/frontend/application/lib/services/productService.ts +++ b/frontend/application/lib/services/productService.ts @@ -45,7 +45,7 @@ export class ProductService { name: data.name, scientificTagline: data.scientificTagline, description: data.description, - shortDescription: data.shortDescription, + shortDescription: data.shortDescription || (data.description ? (data.description.split(/[.।]/)[0].trim() + '.') : ''), price: data.priceDisplay || `${data.priceValue.toLocaleString('fa-IR')} تومان`, priceValue: Number(data.priceValue), category: data.category?.name || data.category || CATEGORY_SLUG_TO_NAME[data.categorySlug] || data.categorySlug || '',