AddForm.tsx
2 years ago
Banner.tsx
2 years ago
EditForm.tsx
2 years ago
FormBuilderButton.tsx
1 year ago
FormBuilderButtonPortal.tsx
2 years ago
EditForm.tsx
52 lines
| 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 | return ( |
| 16 | <> |
| 17 | <FormBuilderButtonPortal |
| 18 | showDialog={state.show} |
| 19 | setShowDialog={setState} |
| 20 | isUpgrading={state.upgrading} |
| 21 | isEditing={true} |
| 22 | /> |
| 23 | |
| 24 | {!window.GiveDonationForms.isMigrated && ( |
| 25 | <div className={styles.migrationGuideBox}> |
| 26 | <div className={styles.migrationGuideTitle}> |
| 27 | <CompassIcon /> |
| 28 | {__('Migration Guide', 'give')} |
| 29 | </div> |
| 30 | |
| 31 | <div className={styles.migrationGuideContent}> |
| 32 | {__('Easily upgrade your form to support the new form builder', 'give')} |
| 33 | </div> |
| 34 | |
| 35 | <Button |
| 36 | onClick={(e) => { |
| 37 | e.preventDefault(); |
| 38 | setState({ |
| 39 | upgrading: true, |
| 40 | show: true |
| 41 | }); |
| 42 | }} |
| 43 | style={{width: '100%'}} |
| 44 | > |
| 45 | {__('Upgrade this form', 'give')} |
| 46 | </Button> |
| 47 | </div> |
| 48 | )} |
| 49 | </> |
| 50 | ) |
| 51 | } |
| 52 |