Skip to content

Commit 1f46cd1

Browse files
committed
fix(pf4): wix wizard buttons layout
1 parent 692bca4 commit 1f46cd1

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

packages/common/config/webpack.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ const devConfig = {
2626
process: 'process/browser.js'
2727
})
2828
],
29+
devServer: {
30+
port: 3000,
31+
},
2932
module: {
3033
rules: [
3134
{

packages/pf4-component-mapper/src/wizard/wizard-components/step-buttons.js

+48-38
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button } from '@patternfly/react-core';
2+
import { Button, ActionList, ActionListGroup, ActionListItem } from '@patternfly/react-core';
33
import selectNext from '@data-driven-forms/common/wizard/select-next';
44
import { FormSpy } from '@data-driven-forms/react-form-renderer';
55

@@ -30,43 +30,53 @@ const WizardStepButtons = ({
3030
conditionalSubmitFlag,
3131
}) => (
3232
<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>
7080
</footer>
7181
);
7282

0 commit comments

Comments
 (0)