From 6623235bb9e451debc4c16acde3d14b1824741b9 Mon Sep 17 00:00:00 2001 From: Rish Date: Wed, 10 Jun 2020 19:52:38 +0530 Subject: [PATCH] Handled `allowSelfSignup` option for allowed plans refs https://github.com/TryGhost/members.js/issues/43 - If the self signup flag is off in member settings, removes the free plan option from Signup flow --- ghost/portal/src/components/pages/SignupPage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ghost/portal/src/components/pages/SignupPage.js b/ghost/portal/src/components/pages/SignupPage.js index 3313cc72e8..5abbe3bf33 100644 --- a/ghost/portal/src/components/pages/SignupPage.js +++ b/ghost/portal/src/components/pages/SignupPage.js @@ -66,12 +66,15 @@ class SignupPage extends React.Component { } renderPlans() { - const {plans} = this.context.site; + const {plans, allowSelfSignup} = this.context.site; const plansData = [ - {type: 'free', price: 'Decide later', name: 'Free'}, {type: 'month', price: plans.monthly, currency: plans.currency_symbol, name: 'Monthly'}, {type: 'year', price: plans.yearly, currency: plans.currency_symbol, name: 'Yearly'} ]; + if (allowSelfSignup) { + plansData.unshift({type: 'free', price: 'Decide later', name: 'Free'}); + } + return ( this.handleSelectPlan(e, name)}/> );