|
1 | 1 | import React from 'react';
|
2 |
| -import { Button } from '@patternfly/react-core'; |
| 2 | +import { Button, ActionList, ActionListGroup, ActionListItem } from '@patternfly/react-core'; |
3 | 3 | import selectNext from '@data-driven-forms/common/wizard/select-next';
|
4 | 4 | import { FormSpy } from '@data-driven-forms/react-form-renderer';
|
5 | 5 |
|
@@ -30,43 +30,53 @@ const WizardStepButtons = ({
|
30 | 30 | conditionalSubmitFlag,
|
31 | 31 | }) => (
|
32 | 32 | <footer className={`pf-v6-c-wizard__footer ${buttonsClassName ? buttonsClassName : ''}`}>
|
33 |
| - {Buttons ? ( |
34 |
| - <Buttons |
35 |
| - disableBack={disableBack} |
36 |
| - handlePrev={handlePrev} |
37 |
| - nextStep={nextStep} |
38 |
| - handleNext={handleNext} |
39 |
| - buttonsClassName={buttonsClassName} |
40 |
| - buttonLabels={{ cancel, submit, back, next }} |
41 |
| - renderNextButton={(args) => ( |
42 |
| - <NextButton {...formOptions} handleNext={handleNext} nextStep={nextStep} nextLabel={next} submitLabel={submit} {...args} /> |
43 |
| - )} |
44 |
| - selectNext={selectNext} |
45 |
| - /> |
46 |
| - ) : ( |
47 |
| - <FormSpy> |
48 |
| - {() => ( |
49 |
| - <React.Fragment> |
50 |
| - <NextButton |
51 |
| - {...formOptions} |
52 |
| - conditionalSubmitFlag={conditionalSubmitFlag} |
53 |
| - handleNext={handleNext} |
54 |
| - nextStep={nextStep} |
55 |
| - nextLabel={next} |
56 |
| - submitLabel={submit} |
57 |
| - /> |
58 |
| - <Button type="button" variant="secondary" isDisabled={disableBack} onClick={handlePrev}> |
59 |
| - {back} |
60 |
| - </Button> |
61 |
| - <div className="pf-v6-c-wizard__footer-cancel"> |
62 |
| - <Button type="button" variant="link" onClick={formOptions.onCancel}> |
63 |
| - {cancel} |
64 |
| - </Button> |
65 |
| - </div> |
66 |
| - </React.Fragment> |
67 |
| - )} |
68 |
| - </FormSpy> |
69 |
| - )} |
| 33 | + <ActionList> |
| 34 | + {Buttons ? ( |
| 35 | + <Buttons |
| 36 | + disableBack={disableBack} |
| 37 | + handlePrev={handlePrev} |
| 38 | + nextStep={nextStep} |
| 39 | + handleNext={handleNext} |
| 40 | + buttonsClassName={buttonsClassName} |
| 41 | + buttonLabels={{ cancel, submit, back, next }} |
| 42 | + renderNextButton={(args) => ( |
| 43 | + <NextButton {...formOptions} handleNext={handleNext} nextStep={nextStep} nextLabel={next} submitLabel={submit} {...args} /> |
| 44 | + )} |
| 45 | + selectNext={selectNext} |
| 46 | + /> |
| 47 | + ) : ( |
| 48 | + <FormSpy> |
| 49 | + {() => ( |
| 50 | + <React.Fragment> |
| 51 | + <ActionListGroup> |
| 52 | + <ActionListItem> |
| 53 | + <NextButton |
| 54 | + {...formOptions} |
| 55 | + conditionalSubmitFlag={conditionalSubmitFlag} |
| 56 | + handleNext={handleNext} |
| 57 | + nextStep={nextStep} |
| 58 | + nextLabel={next} |
| 59 | + submitLabel={submit} |
| 60 | + /> |
| 61 | + </ActionListItem> |
| 62 | + <ActionListItem> |
| 63 | + <Button type="button" variant="secondary" isDisabled={disableBack} onClick={handlePrev}> |
| 64 | + {back} |
| 65 | + </Button> |
| 66 | + </ActionListItem> |
| 67 | + </ActionListGroup> |
| 68 | + <ActionListGroup> |
| 69 | + <ActionListItem> |
| 70 | + <Button type="button" variant="link" onClick={formOptions.onCancel}> |
| 71 | + {cancel} |
| 72 | + </Button> |
| 73 | + </ActionListItem> |
| 74 | + </ActionListGroup> |
| 75 | + </React.Fragment> |
| 76 | + )} |
| 77 | + </FormSpy> |
| 78 | + )} |
| 79 | + </ActionList> |
70 | 80 | </footer>
|
71 | 81 | );
|
72 | 82 |
|
|
0 commit comments