PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.13.2
GiveWP – Donation Plugin and Fundraising Platform v4.13.2
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 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Promotions / WelcomeBanner / resources / js / index.tsx
index.tsx
38 lines 766 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import App from './app/app';
2 import {StrictMode} from 'react';
3 import {createRoot} from 'react-dom/client';
4
5 type windowData = {
6 assets: string;
7 action: string;
8 nonce: string;
9 root: string;
10 };
11
12 declare const window: {
13 WelcomeBanner: windowData;
14 } & Window;
15
16 export default function getWindowData(): windowData {
17 return window.WelcomeBanner;
18 }
19
20 const root = document.getElementById('givewp-welcome-banner');
21
22 /**
23 * @since 3.0.0
24 */
25 const RenderApp = () => (
26 <StrictMode>
27 <App />
28 </StrictMode>
29 );
30
31 if (root) {
32 const pluginHeader = document.querySelector('.wp-header-end');
33 // Place banner underneath Plugin header
34 pluginHeader.insertAdjacentElement('afterend', root);
35
36 createRoot(root).render(<RenderApp />);
37 }
38