From c20fbb5a71bd8490094043f7cba7a48ed563c420 Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Mon, 28 Mar 2022 13:38:05 +0200 Subject: [PATCH] Added default product descriptions --- .../src/components/common/ProductsSection.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ghost/portal/src/components/common/ProductsSection.js b/ghost/portal/src/components/common/ProductsSection.js index 0c0e456760..4b792f0f32 100644 --- a/ghost/portal/src/components/common/ProductsSection.js +++ b/ghost/portal/src/components/common/ProductsSection.js @@ -524,7 +524,7 @@ function FreeProductCard({products, handleChooseSignup}) { let cardClass = selectedProduct === 'free' ? 'gh-portal-product-card free checked' : 'gh-portal-product-card free'; const product = getFreeProduct({site}); - const freeProductDescription = getFreeTierDescription({site}); + let freeProductDescription = getFreeTierDescription({site}); let disabled = (action === 'signup:running') ? true : false; @@ -541,15 +541,19 @@ function FreeProductCard({products, handleChooseSignup}) { } const hasOnlyFree = hasOnlyFreeProduct({site}); + const freeBenefits = getFreeProductBenefits({site}); if (hasOnlyFree) { - const freeBenefits = getFreeProductBenefits({site}); if (!freeProductDescription && !freeBenefits.length) { return null; } cardClass += ' only-free'; } + if (!freeProductDescription && !freeBenefits.length) { + freeProductDescription = 'Free preview'; + } + return ( <>
{ @@ -602,6 +606,11 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup}) disabled = true; } + let productDescription = product.description; + if ((!product.benefits || !product.benefits.length) && !productDescription) { + productDescription = 'Full access'; + } + return ( <>
{ @@ -614,7 +623,9 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup})
- {product.description ?
{product.description}
: ''} +
+ {productDescription} +