0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Added default product descriptions

This commit is contained in:
Peter Zimon 2022-03-28 13:38:05 +02:00
parent 4af2a89f13
commit c20fbb5a71

View file

@ -524,7 +524,7 @@ function FreeProductCard({products, handleChooseSignup}) {
let cardClass = selectedProduct === 'free' ? 'gh-portal-product-card free checked' : 'gh-portal-product-card free'; let cardClass = selectedProduct === 'free' ? 'gh-portal-product-card free checked' : 'gh-portal-product-card free';
const product = getFreeProduct({site}); const product = getFreeProduct({site});
const freeProductDescription = getFreeTierDescription({site}); let freeProductDescription = getFreeTierDescription({site});
let disabled = (action === 'signup:running') ? true : false; let disabled = (action === 'signup:running') ? true : false;
@ -541,15 +541,19 @@ function FreeProductCard({products, handleChooseSignup}) {
} }
const hasOnlyFree = hasOnlyFreeProduct({site}); const hasOnlyFree = hasOnlyFreeProduct({site});
const freeBenefits = getFreeProductBenefits({site});
if (hasOnlyFree) { if (hasOnlyFree) {
const freeBenefits = getFreeProductBenefits({site});
if (!freeProductDescription && !freeBenefits.length) { if (!freeProductDescription && !freeBenefits.length) {
return null; return null;
} }
cardClass += ' only-free'; cardClass += ' only-free';
} }
if (!freeProductDescription && !freeBenefits.length) {
freeProductDescription = 'Free preview';
}
return ( return (
<> <>
<div className={cardClass} onClick={(e) => { <div className={cardClass} onClick={(e) => {
@ -602,6 +606,11 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup})
disabled = true; disabled = true;
} }
let productDescription = product.description;
if ((!product.benefits || !product.benefits.length) && !productDescription) {
productDescription = 'Full access';
}
return ( return (
<> <>
<div className={cardClass} key={product.id} onClick={(e) => { <div className={cardClass} key={product.id} onClick={(e) => {
@ -614,7 +623,9 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup})
</div> </div>
<div className='gh-portal-product-card-details'> <div className='gh-portal-product-card-details'>
<div className='gh-portal-product-card-detaildata'> <div className='gh-portal-product-card-detaildata'>
{product.description ? <div className="gh-portal-product-description">{product.description}</div> : ''} <div className="gh-portal-product-description">
{productDescription}
</div>
<ProductBenefitsContainer product={product} /> <ProductBenefitsContainer product={product} />
</div> </div>
<div className='gh-portal-btn-product'> <div className='gh-portal-btn-product'>