diff --git a/ghost/portal/src/components/common/ProductsSection.js b/ghost/portal/src/components/common/ProductsSection.js index 8962283cb7..dff87475dc 100644 --- a/ghost/portal/src/components/common/ProductsSection.js +++ b/ghost/portal/src/components/common/ProductsSection.js @@ -224,18 +224,6 @@ export const ProductsSectionStyles = ({site}) => { margin-top: 16px; } - .gh-portal-product-card-pricecontainer-old { - display: flex; - flex-direction: row; - align-items: flex-end; - justify-content: space-between; - flex-wrap: wrap; - row-gap: 10px; - column-gap: 4px; - width: 100%; - margin-top: 16px; - } - .gh-portal-product-price { display: flex; justify-content: center; @@ -514,7 +502,6 @@ export const ProductsSectionStyles = ({site}) => { `; }; -const freeTrialFlag = 1; const ProductsContext = React.createContext({ selectedInterval: 'month', selectedProduct: 'free', @@ -589,6 +576,7 @@ function ProductCardTrialDays({trialDays, discount, selectedInterval}) { function ProductCardPrice({product}) { const {selectedInterval} = useContext(ProductsContext); + const {site} = useContext(AppContext); const monthlyPrice = product.monthlyPrice; const yearlyPrice = product.yearlyPrice; const trialDays = product.trial_days; @@ -601,7 +589,7 @@ function ProductCardPrice({product}) { const yearlyDiscount = calculateDiscount(product.monthlyPrice.amount, product.yearlyPrice.amount); const currencySymbol = getCurrencySymbol(activePrice.currency); - if (freeTrialFlag) { + if (hasFreeTrialTier({site})) { return ( <>
@@ -622,13 +610,15 @@ function ProductCardPrice({product}) { } return ( -
-
- 1 ? ' long' : '')}>{currencySymbol} - {formatNumber(getStripeAmount(activePrice.amount))} - /{activePrice.interval} +
+
+
+ 1 ? ' long' : '')}>{currencySymbol} + {formatNumber(getStripeAmount(activePrice.amount))} + /{activePrice.interval} +
+ {(selectedInterval === 'year' ? : '')}
- {(selectedInterval === 'year' ? : '')}
); @@ -747,43 +737,6 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup}) productDescription = 'Full access'; } - if (freeTrialFlag) { - return ( - <> -
{ - e.stopPropagation(); - setSelectedProduct(product.id); - }}> -
-

{product.name}

- -
-
-
-
- {productDescription} -
- -
-
- -
-
-
- - ); - } - return ( <>
{ @@ -809,7 +762,9 @@ function ProductCard({product, products, selectedInterval, handleChooseSignup}) const selectedPrice = getSelectedPrice({products, selectedInterval, selectedProduct: product.id}); handleChooseSignup(e, selectedPrice.id); }}> - {((selectedProduct === product.id && disabled) ? : (noOfProducts > 1 ? 'Choose' : 'Continue'))} +
@@ -839,23 +794,19 @@ function YearlyDiscount({discount, trialDays}) { return null; } - if (freeTrialFlag) { - if (hasFreeTrialTier({site})) { - return ( - <> - {discount}% discount - - ); - } else { - return null; - } + if (hasFreeTrialTier({site})) { + return ( + <> + {discount}% discount + + ); + } else { + return ( + <> + {discount}% discount + + ); } - - return ( - <> - {discount}% discount - - ); } function ProductPriceSwitch({products, selectedInterval, setSelectedInterval}) {