Skip to content

Commit 099dd9d

Browse files
committed
rm modalbody from example and revise modal doc
1 parent 43a5d07 commit 099dd9d

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ DrawerHead,
3535
DrawerActions,
3636
DrawerCloseButton,
3737
Modal,
38-
ModalBody,
3938
ModalVariant,
4039
Wizard,
4140
WizardFooter,

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

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { Button, Modal, ModalBody, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core';
2+
import { Button, Modal, ModalVariant, Wizard, WizardHeader, WizardStep } from '@patternfly/react-core';
33

44
export const WizardWithinModal: React.FunctionComponent = () => {
55
const [isModelOpen, setIsModalOpen] = React.useState(false);
@@ -14,34 +14,32 @@ export const WizardWithinModal: React.FunctionComponent = () => {
1414
onEscapePress={() => setIsModalOpen(false)}
1515
variant={ModalVariant.medium}
1616
>
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-
}
17+
<Wizard
18+
height={400}
19+
onClose={() => setIsModalOpen(false)}
20+
title="In modal wizard"
21+
header={
22+
<WizardHeader
23+
onClose={() => setIsModalOpen(false)}
24+
title="Wizard in modal"
25+
description="Simple wizard description"
26+
/>
27+
}
28+
>
29+
<WizardStep name="Step 1" id="in-modal-step-1">
30+
Step 1 content
31+
</WizardStep>
32+
<WizardStep name="Step 2" id="in-modal-step-2">
33+
Step 2 content
34+
</WizardStep>
35+
<WizardStep
36+
name="Review"
37+
id="in-modal-review-step"
38+
footer={{ nextButtonText: 'Finish', onNext: () => setIsModalOpen(false) }}
2939
>
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>
40+
Review step content
41+
</WizardStep>
42+
</Wizard>
4543
</Modal>
4644
</>
4745
);

0 commit comments

Comments
 (0)