| 1 |
import { Wizard as WizardDeprecated, WizardStep } from '@patternfly/react-core/deprecated'; |
| 2 |
|
| 3 |
export const WizardGetCurrentStep: React.FunctionComponent = () => { |
| 4 |
const onCurrentStepChanged = ({ id }: WizardStep) => { |
| 5 |
// eslint-disable-next-line no-console |
| 6 |
console.log(id); |
| 7 |
}; |
| 8 |
const closeWizard = () => { |
| 9 |
// eslint-disable-next-line no-console |
| 10 |
console.log('close wizard'); |
| 11 |
}; |
| 12 |
|
| 13 |
const steps = [ |
| 14 |
{ id: 1, name: 'First step', component: <p>Step 1 content</p> }, |
| 15 |
{ id: 2, name: 'Second step', component: <p>Step 2 content</p> }, |
| 16 |
{ id: 3, name: 'Third step', component: <p>Step 3 content</p> }, |
| 17 |
{ id: 4, name: 'Fourth step', component: <p>Step 4 content</p> }, |
| 18 |
{ id: 5, name: 'Review', component: <p>Review step content</p>, nextButtonText: 'Finish' } |
| 19 |
]; |
| 20 |
const title = 'Get current step wizard example'; |
| 21 |
return ( |
| 22 |
<WizardDeprecated |
| 23 |
navAriaLabel={`${title} steps`} |
| 24 |
mainAriaLabel={`${title} content`} |
| 25 |
onClose={closeWizard} |
| 26 |
description="Simple Wizard Description" |
| 27 |
steps={steps} |
| 28 |
height={400} |
| 29 |
onCurrentStepChanged={onCurrentStepChanged} |
| 30 |
/> |
| 31 |
); |
| 32 |
}; |