Skip to content

Commit

Permalink
Refactor: update plans & pricing content in add-ons page (#7044)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaHungDinh authored Nov 2, 2023
1 parent 5744000 commit 1a61550
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ export function AddonsAdminPage({startingTab = 0}) {
}}
/>
<TabList className={styles.tabs}>
<Tab id="tab-1">{__('Must Have Add-ons', 'give')}</Tab>
<Tab id="tab-2">{__('View Pricing Plans', 'give')}</Tab>
<Tab id="tab-1">{__('View Pricing Plans', 'give')}</Tab>
<Tab id="tab-2">{__('Must Have Add-ons', 'give')}</Tab>
<Tab id="tab-3">{__('Additional Add-ons', 'give')}</Tab>
<Tab id="tab-4">{__('Get a Free Add-on!', 'give')}</Tab>
</TabList>
</div>
</div>
<div className={styles.container}>
<TabPanel id="tab-1">
<MustHaveAddons />
<PricingPlans />
</TabPanel>
<TabPanel id="tab-2">
<PricingPlans />
<MustHaveAddons />
</TabPanel>
<TabPanel id="tab-3">
<AdditionalAddons />
Expand All @@ -79,4 +79,4 @@ export function AddonsAdminPage({startingTab = 0}) {
</div>
</Tabs>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,19 @@ import styles from './PricingPlans.module.css';

const {heading, description, plansButtonCaption, plans} = window.GiveAddons.pricingPlans;

const customPlanOrder = ['Plus Plan', 'Pro Plan', 'Basic Plan', 'Agency Plan'];

const sortedPlans = plans.slice().sort((a, b) => {
const aIndex = customPlanOrder.indexOf(a.name);
const bIndex = customPlanOrder.indexOf(b.name);
return aIndex - bIndex;
});

export const PricingPlans = () => (
<article>
<Hero heading={heading} description={description} />
<ul className={styles.plans}>
{plans.map((plan) => (
{sortedPlans.map((plan) => (
<li key={plan.name}>
<PricingPlanCard
name={plan.name}
Expand Down
4 changes: 0 additions & 4 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ mix.webpackConfig({
'@givewp/promotions': path.resolve(__dirname, 'src/Promotions/sharedResources/'),
},
},
externals: {
react: 'React',
'react-dom': 'ReactDOM',
},
plugins: [
/*
* Transform script dependencies only for following external libraries:
Expand Down

0 comments on commit 1a61550

Please sign in to comment.