AdditionalAddonCard.js
4 years ago
AdditionalAddonCard.module.css
4 years ago
AdditionalAddons.js
4 years ago
AdditionalAddons.module.css
4 years ago
AddonsAdminPage.js
2 years ago
AddonsAdminPage.module.css
2 years ago
Button.js
4 years ago
Button.module.css
4 years ago
Card.js
4 years ago
Card.module.css
4 years ago
FreeAddOnTab.js
4 years ago
FreeAddOnTab.module.css
4 years ago
Hero.js
4 years ago
Hero.module.css
4 years ago
MustHaveAddonCard.js
4 years ago
MustHaveAddonCard.module.css
4 years ago
MustHaveAddons.js
4 years ago
MustHaveAddons.module.css
4 years ago
PricingPlanCard.js
4 years ago
PricingPlanCard.module.css
4 years ago
PricingPlans.js
2 years ago
PricingPlans.module.css
4 years ago
PricingPlans.js
36 lines
| 1 | import {PricingPlanCard} from './PricingPlanCard'; |
| 2 | import {Hero} from './Hero'; |
| 3 | import styles from './PricingPlans.module.css'; |
| 4 | |
| 5 | const {heading, description, plansButtonCaption, plans} = window.GiveAddons.pricingPlans; |
| 6 | |
| 7 | const customPlanOrder = ['Plus Plan', 'Pro Plan', 'Basic Plan', 'Agency Plan']; |
| 8 | |
| 9 | const sortedPlans = plans.slice().sort((a, b) => { |
| 10 | const aIndex = customPlanOrder.indexOf(a.name); |
| 11 | const bIndex = customPlanOrder.indexOf(b.name); |
| 12 | return aIndex - bIndex; |
| 13 | }); |
| 14 | |
| 15 | export const PricingPlans = () => ( |
| 16 | <article> |
| 17 | <Hero heading={heading} description={description} /> |
| 18 | <ul className={styles.plans}> |
| 19 | {sortedPlans.map((plan) => ( |
| 20 | <li key={plan.name}> |
| 21 | <PricingPlanCard |
| 22 | name={plan.name} |
| 23 | description={plan.description} |
| 24 | actionText={plansButtonCaption} |
| 25 | actionLink={plan.url} |
| 26 | icon={plan.icon} |
| 27 | savingsPercentage={plan.savingsPercentage} |
| 28 | includes={plan.includes} |
| 29 | isMostPopular={plan.mostPopular} |
| 30 | /> |
| 31 | </li> |
| 32 | ))} |
| 33 | </ul> |
| 34 | </article> |
| 35 | ); |
| 36 |