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 / DonationForms / V2 / resources / components / Onboarding / Components / Banner.tsx

Banner.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/DonationForms/V2/resources/components/Onboarding/Components/Banner.tsx

47 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {useContext} from 'react';
2 import {__} from '@wordpress/i18n';
3 import {ExitIcon, StarsIcon} from '@givewp/components/AdminUI/Icons';
4 import {OnboardingContext} from '../index';
5 import styles from '../style.module.scss';
6
7 export default function Banner() {
8
9 const [, setState] = useContext(OnboardingContext);
10
11 const openFeatureNoticeModal = () => setState(prev => ({
12 ...prev,
13 showFeatureNoticeDialog: true
14 }));
15
16 const handleClose = () => {
17 fetch(window.GiveDonationForms.bannerActionUrl, {method: 'POST'})
18 .then(() => setState(prev => ({
19 ...prev,
20 showBanner: false
21 })))
22 };
23
24
25 return (
26 <div className={styles.banner}>
27 <div className={styles.icon}>
28 <StarsIcon />
29 </div>
30 <div className={styles.text}>
31 <span>
32 {__('GiveWP 3.0 introduces customizable and flexible forms powered by the new Visual Donation Form Builder.', 'give')}
33 </span>
34 <button
35 className={styles.button}
36 onClick={openFeatureNoticeModal}
37 >
38 {__('Try the new form builder', 'give')}
39 </button>
40 </div>
41 <div className={styles.closeIcon}>
42 <ExitIcon onClick={handleClose} />
43 </div>
44 </div>
45 );
46 }
47