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
This commit is contained in:
parent
66479c1990
commit
6623235bb9
@ -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 (
|
||||
<PlansSection plans={plansData} selectedPlan={this.state.plan} onPlanSelect={(e, name) => this.handleSelectPlan(e, name)}/>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user