From e419c3f8688c5d361fee081c95d10e2104db3ec2 Mon Sep 17 00:00:00 2001 From: Heath Raftery Date: Tue, 2 Nov 2021 16:43:40 +1100 Subject: [PATCH] Updated check for showing upgrade CTA in account welcome page (#182) Co-authored-by: Heath Raftery - removes upgrade CTA if there are no paid plans available in portal to upgrade Context: When first configuring Portal, it is reasonable and straight-forward to connect a Stripe account as instructed, but then disable the paid tiers to delay presenting paid memberships until the site is mature enough to warrant paid memberships. This results in a very functional Portal, which prompts for, processes and accepts free membership. After logging into a free account however, the Portal displays a call-to-action paragraph encouraging the user to upgrade to a paid account. Obviously this is confusing for the user, given that there are no paid options. The result is no change for sites that have paid memberships, or do not have Stripe configured. But if the only membership plan is free, then the cta text is not added to the page, just as it would not be if Stripe was not configured or the subscription was complimentary or cancelled. --- ghost/portal/src/components/pages/AccountHomePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/portal/src/components/pages/AccountHomePage.js b/ghost/portal/src/components/pages/AccountHomePage.js index 65fbbb7796..926e3aa07b 100644 --- a/ghost/portal/src/components/pages/AccountHomePage.js +++ b/ghost/portal/src/components/pages/AccountHomePage.js @@ -313,7 +313,7 @@ const AccountWelcome = () => { const {member, site} = useContext(AppContext); const {is_stripe_configured: isStripeConfigured} = site; - if (!isStripeConfigured) { + if (!isStripeConfigured || hasOnlyFreePlan({site})) { return null; } const subscription = getMemberSubscription({member});