DonationReceipt.tsx
6 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
MultiStepForm.tsx
36 lines
| 1 | import {FormProps} from '@givewp/forms/propTypes'; |
| 2 | import {ReactNode} from 'react'; |
| 3 | |
| 4 | interface Props extends FormProps { |
| 5 | previousButton: ReactNode; |
| 6 | nextButton: ReactNode; |
| 7 | submitButton: ReactNode; |
| 8 | } |
| 9 | |
| 10 | export default function MultiStepForm({ |
| 11 | children, |
| 12 | formProps, |
| 13 | formError, |
| 14 | previousButton, |
| 15 | nextButton, |
| 16 | submitButton, |
| 17 | }: Props) { |
| 18 | const FormError = window.givewp.form.templates.layouts.formError; |
| 19 | |
| 20 | return ( |
| 21 | <form {...formProps}> |
| 22 | {children} |
| 23 | |
| 24 | {formError && ( |
| 25 | <section className="givewp-layouts givewp-layouts-section"> |
| 26 | <FormError error={formError} /> |
| 27 | </section> |
| 28 | )} |
| 29 | |
| 30 | {previousButton} |
| 31 | {nextButton} |
| 32 | {submitButton} |
| 33 | </form> |
| 34 | ); |
| 35 | } |
| 36 |