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 / EditForm.tsx

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

75 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import {useState} from 'react';
2 import {__} from '@wordpress/i18n';
3 import FormBuilderButtonPortal from './FormBuilderButtonPortal';
4 import Button from '@givewp/components/AdminUI/Button';
5 import {CompassIcon} from '@givewp/components/AdminUI/Icons';
6 import styles from '../style.module.scss';
7
8 export default function EditForm() {
9
10 const [state, setState] = useState({
11 show: false,
12 upgrading: false
13 });
14
15 const {isMigrated, migratedFormUrl} = window.GiveDonationForms;
16
17 return (
18 <>
19 <FormBuilderButtonPortal
20 showDialog={state.show}
21 setShowDialog={setState}
22 isUpgrading={state.upgrading}
23 isEditing={true}
24 />
25
26 {isMigrated && migratedFormUrl ? (
27 <div className={styles.migrationGuideBox}>
28 <div className={styles.migrationGuideTitle}>
29 <CompassIcon />
30 {__('Upgrade in Progress', 'give')}
31 </div>
32
33 <div className={styles.migrationGuideContent}>
34 {__('This form has been upgraded to the Visual Form Builder. Complete the transfer to finalize the upgrade.', 'give')}
35 </div>
36
37 <Button
38 onClick={(e) => {
39 e.preventDefault();
40 window.location.href = migratedFormUrl;
41 }}
42 style={{width: '100%'}}
43 >
44 {__('Continue editing upgraded form', 'give')}
45 </Button>
46 </div>
47 ) : !isMigrated && (
48 <div className={styles.migrationGuideBox}>
49 <div className={styles.migrationGuideTitle}>
50 <CompassIcon />
51 {__('Migration Guide', 'give')}
52 </div>
53
54 <div className={styles.migrationGuideContent}>
55 {__('Easily upgrade your form to support the new form builder', 'give')}
56 </div>
57
58 <Button
59 onClick={(e) => {
60 e.preventDefault();
61 setState({
62 upgrading: true,
63 show: true
64 });
65 }}
66 style={{width: '100%'}}
67 >
68 {__('Upgrade this form', 'give')}
69 </Button>
70 </div>
71 )}
72 </>
73 )
74 }
75