PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.17.0
GiveWP – Donation Plugin and Fundraising Platform v4.17.0
4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 All 256 releases
give / src / Promotions / InPluginUpsells / resources / js / components / PricingPlanCard.js

PricingPlanCard.js in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/Promotions/InPluginUpsells/resources/js/components/PricingPlanCard.js

64 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {useMemo} from 'react';
2 import {kebabCase} from 'lodash';
3 import {Button} from './Button';
4 import {Card} from './Card';
5 import {transformEmphasis, transformStrong} from '../utils';
6
7 import styles from './PricingPlanCard.module.css';
8
9 export const PricingPlanCard = ({
10 name,
11 description,
12 actionText,
13 actionLink,
14 icon,
15 includes,
16 savingsPercentage,
17 isMostPopular,
18 }) => {
19 const includesLabelId = useMemo(() => `${kebabCase(name)}-includes-label`, [name]);
20
21 return (
22 <Card as="article" className={styles.card}>
23 <div>
24 <div className={styles.nameAndFlag}>
25 <h3 className={styles.title}>
26 <img className={styles.icon} src={icon} alt="" />
27 {name}
28 </h3>
29 {isMostPopular && <div className={styles.mostPopularFlag}>Most Popular</div>}
30 </div>
31 <p className={styles.description} dangerouslySetInnerHTML={{__html: transformStrong(description)}} />
32 <div className={styles.actionAndSavings}>
33 <Button as="a" href={actionLink} rel="noopener" target="_blank" className={styles.button}>
34 {actionText}
35 </Button>
36 <p className={styles.savings}>Save over {savingsPercentage}%</p>
37 </div>
38 </div>
39 <aside aria-labelledby={includesLabelId} className={styles.includes}>
40 <h4 id={includesLabelId} className={styles.includesLabel}>
41 <span className="screen-reader-text">{name} </span>Includes
42 </h4>
43 <ul className={styles.includesList}>
44 {includes.map((include) => (
45 <li key={include.feature} className={styles.include}>
46 {include.icon && <img src={include.icon} alt="" className={styles.includeIcon} />}
47 {include.link ? (
48 <a
49 href={include.link}
50 target="_blank"
51 rel="noopener"
52 dangerouslySetInnerHTML={{__html: transformEmphasis(include.feature)}}
53 />
54 ) : (
55 <span dangerouslySetInnerHTML={{__html: transformEmphasis(include.feature)}} />
56 )}
57 </li>
58 ))}
59 </ul>
60 </aside>
61 </Card>
62 );
63 };
64