Skip to content

Commit

Permalink
fix: slice product name in ProductCard if len exceeds 15
Browse files Browse the repository at this point in the history
  • Loading branch information
alvyynm committed Oct 29, 2024
1 parent 26c3f34 commit 97757b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/shop/ProductCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function ProductCard({ product }) {
className="flex justify-between pr-1"
>
<h3 className="text-md uppercase font-medium text-gray-600">
{product.name}
{product.name.length > 15
? `${product.name.slice(0, 18)}...`
: product.name}
</h3>
<div className="p-1 rounded-xl bg-green-dark/10">
{totalStock > 0 ? (
Expand Down

0 comments on commit 97757b8

Please sign in to comment.