From 6d6969f4b09484f84087eb52629d3bd69b4ea0dc Mon Sep 17 00:00:00 2001 From: Peter Zimon Date: Mon, 4 Mar 2024 16:27:30 +0100 Subject: [PATCH] Portal signup page spacing fixes (#19791) refs. https://linear.app/tryghost/issue/DES-161/portal-signup-window-spacing-problem The products section is returned even if there's only a free product in the publication. This results in an extra, unnecessary space between the signup form inputs and the signup button. --- .../src/components/common/ProductsSection.js | 8 +++++++- apps/portal/src/components/pages/SignupPage.js | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/apps/portal/src/components/common/ProductsSection.js b/apps/portal/src/components/common/ProductsSection.js index 4c7e43ea00..4c352631ec 100644 --- a/apps/portal/src/components/common/ProductsSection.js +++ b/apps/portal/src/components/common/ProductsSection.js @@ -947,6 +947,7 @@ function ProductsSection({onPlanSelect, products, type = null, handleChooseSignu const activeInterval = getActiveInterval({portalPlans, portalDefaultPlan, selectedInterval}); const isComplimentary = isComplimentaryMember({member}); + const hasOnlyFree = hasOnlyFreeProduct({site}); useEffect(() => { setSelectedProduct(defaultProductId); @@ -978,6 +979,11 @@ function ProductsSection({onPlanSelect, products, type = null, handleChooseSignu className += ' gh-portal-upgrade-product'; } + // If site doesn't have paid products then don't return an empty container + if (hasOnlyFree) { + return null; + } + let finalProduct = products.find(p => p.id === selectedProduct)?.id || products.find(p => p.type === 'paid')?.id; return (
- {(!(hasOnlyFreeProduct({site})) ? + {(!(hasOnlyFree) ?