|
1 | 1 | import React from 'react'; |
2 | | -import { Button, Wizard, WizardStep, WizardHeader } from '@patternfly/react-core'; |
3 | | -import { Modal as ModalDeprecated, ModalVariant as ModalVariantDeprecated } from '@patternfly/react-core/deprecated'; |
| 2 | +import { Button, Modal, ModalBody, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core'; |
4 | 3 |
|
5 | | -export const WizardWithinModal = () => { |
| 4 | +export const WizardWithinModal: React.FunctionComponent = () => { |
6 | 5 | const [isModelOpen, setIsModalOpen] = React.useState(false); |
7 | 6 |
|
8 | 7 | return ( |
9 | 8 | <> |
10 | 9 | <Button onClick={() => setIsModalOpen(true)}>Show Modal</Button> |
11 | 10 |
|
12 | | - <ModalDeprecated |
| 11 | + <Modal |
13 | 12 | isOpen={isModelOpen} |
14 | | - showClose={false} |
15 | 13 | aria-label="Wizard modal" |
16 | | - hasNoBodyWrapper |
17 | 14 | onEscapePress={() => setIsModalOpen(false)} |
18 | | - variant={ModalVariantDeprecated.medium} |
| 15 | + variant={ModalVariant.medium} |
19 | 16 | > |
20 | | - <Wizard |
21 | | - height={400} |
22 | | - onClose={() => setIsModalOpen(false)} |
23 | | - title="In modal wizard" |
24 | | - header={ |
25 | | - <WizardHeader |
26 | | - onClose={() => setIsModalOpen(false)} |
27 | | - title="Wizard in modal" |
28 | | - description="Simple wizard description" |
29 | | - /> |
30 | | - } |
31 | | - > |
32 | | - <WizardStep name="Step 1" id="in-modal-step-1"> |
33 | | - Step 1 content |
34 | | - </WizardStep> |
35 | | - <WizardStep name="Step 2" id="in-modal-step-2"> |
36 | | - Step 2 content |
37 | | - </WizardStep> |
38 | | - <WizardStep |
39 | | - name="Review" |
40 | | - id="in-modal-review-step" |
41 | | - footer={{ nextButtonText: 'Finish', onNext: () => setIsModalOpen(false) }} |
| 17 | + <ModalBody> |
| 18 | + <Wizard |
| 19 | + height={400} |
| 20 | + onClose={() => setIsModalOpen(false)} |
| 21 | + title="In modal wizard" |
| 22 | + header={ |
| 23 | + <WizardHeader |
| 24 | + onClose={() => setIsModalOpen(false)} |
| 25 | + title="Wizard in modal" |
| 26 | + description="Simple wizard description" |
| 27 | + /> |
| 28 | + } |
42 | 29 | > |
43 | | - Review step content |
44 | | - </WizardStep> |
45 | | - </Wizard> |
46 | | - </ModalDeprecated> |
| 30 | + <WizardStep name="Step 1" id="in-modal-step-1"> |
| 31 | + Step 1 content |
| 32 | + </WizardStep> |
| 33 | + <WizardStep name="Step 2" id="in-modal-step-2"> |
| 34 | + Step 2 content |
| 35 | + </WizardStep> |
| 36 | + <WizardStep |
| 37 | + name="Review" |
| 38 | + id="in-modal-review-step" |
| 39 | + footer={{ nextButtonText: 'Finish', onNext: () => setIsModalOpen(false) }} |
| 40 | + > |
| 41 | + Review step content |
| 42 | + </WizardStep> |
| 43 | + </Wizard> |
| 44 | + </ModalBody> |
| 45 | + </Modal> |
47 | 46 | </> |
48 | 47 | ); |
49 | 48 | }; |
0 commit comments