diff --git a/ghost/portal/src/components/common/PlansSection.js b/ghost/portal/src/components/common/PlansSection.js index 34d0b49e35..ae5c1cd630 100644 --- a/ghost/portal/src/components/common/PlansSection.js +++ b/ghost/portal/src/components/common/PlansSection.js @@ -93,7 +93,16 @@ function PlanOptions({plans, selectedPlan, onPlanSelect}) { }); } -function PlansSection({plans, selectedPlan, onPlanSelect, style}) { +function PlanLabel({showLabel}) { + if (!showLabel) { + return null; + } + return ( + + ); +} + +function PlansSection({plans, showLabel = true, selectedPlan, onPlanSelect, style}) { const containerStyle = { display: 'flex', border: '1px solid #c5d2d9', @@ -106,13 +115,9 @@ function PlansSection({plans, selectedPlan, onPlanSelect, style}) { } return (
- +
- +
); diff --git a/ghost/portal/src/components/common/PlansSection.test.js b/ghost/portal/src/components/common/PlansSection.test.js index 2f2e496403..6f2e535996 100644 --- a/ghost/portal/src/components/common/PlansSection.test.js +++ b/ghost/portal/src/components/common/PlansSection.test.js @@ -5,12 +5,11 @@ import PlansSection from './PlansSection'; const setup = (overrides = {}) => { const mockOnPlanSelectFn = jest.fn(); const props = { - plans: { - monthly: 12, - yearly: 110, - currency: 'USD', - currency_symbol: '$' - }, + plans: [ + {type: 'free', price: 'Decide later', name: 'Free'}, + {type: 'month', price: 12, currency: '$', name: 'Monthly'}, + {type: 'year', price: 110, currency: '$', name: 'Yearly'} + ], selectedPlan: 'Monthly', onPlanSelect: mockOnPlanSelectFn }; diff --git a/ghost/portal/src/components/pages/SignupPage.js b/ghost/portal/src/components/pages/SignupPage.js index 4ad44ebc7a..4ca0adcd81 100644 --- a/ghost/portal/src/components/pages/SignupPage.js +++ b/ghost/portal/src/components/pages/SignupPage.js @@ -61,8 +61,13 @@ class SignupPage extends React.Component { renderPlans() { const {plans} = 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'} + ]; return ( - this.handleSelectPlan(e, name)}/> + this.handleSelectPlan(e, name)}/> ); }