feat: fix recommendations card subtitle (#1070)

This commit is contained in:
Zainab Amir
2023-10-06 15:58:29 +05:00
committed by GitHub
parent 332d6abee7
commit 7b4714a22a
2 changed files with 5 additions and 3 deletions

View File

@@ -39,8 +39,8 @@ const BaseCard = ({
/>
<Card.Header
className="mt-2"
title={truncateText(title)}
subtitle={truncateText(subtitle)}
title={truncateText(title, 50)}
subtitle={truncateText(subtitle, 30)}
/>
<Card.Section className="d-flex">
<div className="product-badge">

View File

@@ -47,7 +47,9 @@ export const getVariant = (productType) => (
export const createCodeFriendlyProduct = (type) => type?.replace(/\s+/g, '-').replace(/'/g, '').toLowerCase();
export const truncateText = (input) => (input?.length > 50 ? `${input.substring(0, 50)}...` : input);
export const truncateText = (input, textLength) => (
input?.length > textLength ? `${input.substring(0, textLength)}...` : input
);
export const filterLocationRestriction = (products, countryCode) => products.filter((product) => {
if (product.locationRestriction) {