Skip to content

Commit 97757b8

Browse files
committed
fix: slice product name in ProductCard if len exceeds 15
1 parent 26c3f34 commit 97757b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/shop/ProductCard.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ function ProductCard({ product }) {
3535
className="flex justify-between pr-1"
3636
>
3737
<h3 className="text-md uppercase font-medium text-gray-600">
38-
{product.name}
38+
{product.name.length > 15
39+
? `${product.name.slice(0, 18)}...`
40+
: product.name}
3941
</h3>
4042
<div className="p-1 rounded-xl bg-green-dark/10">
4143
{totalStock > 0 ? (

0 commit comments

Comments
 (0)