Skip to content

Commit 2de9fea

Browse files
authored
feat(Wizard): replace deprecations in examples (patternfly#11298)
* feat(Wizard): replace deprecations in examples * rm modalbody from example and revise modal doc
1 parent ec4e9b9 commit 2de9fea

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

packages/react-core/src/components/Modal/examples/Modal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Basic modals give users the option to either confirm or cancel an action.
2020

2121
To flag an open modal, use the `isOpen` property. To execute a callback when a modal is closed, use the `onClose` property.
2222

23-
A modal must have a `<ModalBody>`, containing the main content of the modal. The `<ModalHeader>` and `<ModalFooter>` components are not required, but are typically used to display the modal title and any button actions, respectively.
23+
The `<ModalBody>`, `<ModalHeader>`, and `<ModalFooter>` components are not required, but are typically used to display the main content of the modal, modal title, and any button actions, respectively.
2424

2525
```ts file="./ModalBasic.tsx"
2626

packages/react-core/src/components/Wizard/examples/Wizard.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ DrawerColorVariant,
3434
DrawerHead,
3535
DrawerActions,
3636
DrawerCloseButton,
37+
Modal,
38+
ModalVariant,
3739
Wizard,
3840
WizardFooter,
3941
WizardFooterWrapper,
@@ -46,7 +48,6 @@ WizardNavItem,
4648
WizardNav,
4749
WizardHeader
4850
} from '@patternfly/react-core';
49-
import { Modal as ModalDeprecated, ModalVariant as ModalVariantDeprecated } from '@patternfly/react-core/deprecated';
5051
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
5152
import SlackHashIcon from '@patternfly/react-icons/dist/esm/icons/slack-hash-icon';
5253
import CogsIcon from '@patternfly/react-icons/dist/esm/icons/cogs-icon';

packages/react-core/src/components/Wizard/examples/WizardWithinModal.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
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, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core';
43

5-
export const WizardWithinModal = () => {
4+
export const WizardWithinModal: React.FunctionComponent = () => {
65
const [isModelOpen, setIsModalOpen] = React.useState(false);
76

87
return (
98
<>
109
<Button onClick={() => setIsModalOpen(true)}>Show Modal</Button>
1110

12-
<ModalDeprecated
11+
<Modal
1312
isOpen={isModelOpen}
14-
showClose={false}
1513
aria-label="Wizard modal"
16-
hasNoBodyWrapper
1714
onEscapePress={() => setIsModalOpen(false)}
18-
variant={ModalVariantDeprecated.medium}
15+
variant={ModalVariant.medium}
1916
>
2017
<Wizard
2118
height={400}
@@ -43,7 +40,7 @@ export const WizardWithinModal = () => {
4340
Review step content
4441
</WizardStep>
4542
</Wizard>
46-
</ModalDeprecated>
43+
</Modal>
4744
</>
4845
);
4946
};

0 commit comments

Comments
 (0)