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 / ReportsWidgetBanner / components / WidgetBanner / index.tsx

index.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.17.0, at src/Promotions/ReportsWidgetBanner/components/WidgetBanner/index.tsx

52 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {__} from '@wordpress/i18n';
2
3 import './styles.scss';
4 import {getWidgetWindowData} from "../../window/widgetWindow";
5
6
7 type widgetBannerProps = {
8 hideWidgetBanner: (id) => void;
9 };
10
11 export default function WidgetBanner({hideWidgetBanner}: widgetBannerProps) {
12 const banner = getWidgetWindowData().banner;
13
14 const dismissBanner = () => {
15 hideWidgetBanner(banner.id);
16 }
17
18 return (
19 <div id={`givewp-sale-banner-${banner.id}`} className={'givewp-reports-widget-banner'}>
20 <div className={'givewp-reports-widget-banner__header'}>
21 <h1 className={'givewp-reports-widget-banner__header__main'}>{__('Make it yours.', 'give')}</h1>
22 <h2 className={'givewp-reports-widget-banner__header__secondary'}>{__('Save 40% on all GiveWP products', 'give')}</h2>
23 </div>
24 <a className={'givewp-reports-widget-banner__cta'}
25 href={banner.actionUrl}
26 target={"_blank"}
27 rel={"noopener noreferrer"}
28 >
29 {banner.actionText}
30 </a>
31 <button
32 onClick={dismissBanner}
33 type="button"
34 aria-label={__('Dismiss', 'give')}
35 aria-controls={`givewp-sale-banner-${banner.id}`}
36 className={'givewp-reports-widget-banner__dismiss'}
37 >
38 <svg xmlns="http://www.w3.org/2000/svg" width="15px" height="14px" viewBox="0 0 20 19" fill="none">
39 <line x1="1.35355" y1="0.646447" x2="19.3535" y2="18.6464" stroke="#F9FAF9" />
40 <line
41 y1="-0.5"
42 x2="25.4558"
43 y2="-0.5"
44 transform="matrix(0.707107 -0.707106 0.707107 0.707106 1 19)"
45 stroke="#F9FAF9"
46 />
47 </svg>
48 </button>
49 </div>
50 );
51 }
52