PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
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 / Blocks / DonationFormBlock / resources / app / renderDonationForm.tsx

renderDonationForm.tsx in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/DonationForms/Blocks/DonationFormBlock/resources/app/renderDonationForm.tsx

34 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { createRoot } from 'react-dom/client';
2 import DonationFormBlockApp from '.';
3
4 /**
5 * @since 4.7.0
6 */
7 export default function renderDonationForm(root) {
8 let dataSrcUrl = root.getAttribute('data-src');
9 const locale = root.getAttribute('data-form-locale');
10 if (locale) {
11 const url = new URL(dataSrcUrl);
12 url.searchParams.set('locale', locale);
13 dataSrcUrl = url.toString();
14 }
15
16 const dataSrc = dataSrcUrl;
17 const embedId = root.getAttribute('data-givewp-embed-id');
18 const formFormat = root.getAttribute('data-form-format');
19 const openFormButton = root.getAttribute('data-open-form-button');
20 const formUrl = root.getAttribute('data-form-url');
21 const formViewUrl = root.getAttribute('data-form-view-url');
22
23 createRoot(root).render(
24 <DonationFormBlockApp
25 openFormButton={openFormButton}
26 formFormat={formFormat}
27 dataSrc={dataSrc}
28 embedId={embedId}
29 formUrl={formUrl}
30 formViewUrl={formViewUrl}
31 />
32 );
33 }
34