DonationReceipt.tsx
5 months ago
DonationSummaryItems.tsx
1 year ago
FieldDescription.tsx
2 years ago
FieldError.tsx
2 years ago
FieldLabel.tsx
2 years ago
Form.tsx
2 years ago
FormError.tsx
1 year ago
Goal.tsx
1 year ago
GoalAchieved.tsx
2 years ago
Header.tsx
2 years ago
HeaderDescription.tsx
1 year ago
HeaderImage.tsx
2 years ago
HeaderTitle.tsx
2 years ago
MultiStepForm.tsx
2 years ago
NodeWrapper.tsx
2 years ago
Section.tsx
1 year ago
Form.tsx
22 lines
| 1 | import type {FormProps} from '@givewp/forms/propTypes'; |
| 2 | import {__} from '@wordpress/i18n'; |
| 3 | |
| 4 | export default function Form({children, formProps, formError, isSubmitting}: FormProps) { |
| 5 | const {donateButtonCaption} = window.givewp.form.hooks.useDonationFormSettings(); |
| 6 | const FormError = window.givewp.form.templates.layouts.formError; |
| 7 | |
| 8 | return ( |
| 9 | <form {...formProps}> |
| 10 | {children} |
| 11 | |
| 12 | <section className="givewp-layouts givewp-layouts-section"> |
| 13 | {formError && <FormError error={formError} />} |
| 14 | |
| 15 | <button type="submit" disabled={isSubmitting} aria-busy={isSubmitting}> |
| 16 | {isSubmitting ? __('Submitting…', 'give') : donateButtonCaption} |
| 17 | </button> |
| 18 | </section> |
| 19 | </form> |
| 20 | ); |
| 21 | } |
| 22 |