Skip to content

Commit

Permalink
lib: add showClose as Dialog's prop
Browse files Browse the repository at this point in the history
  • Loading branch information
skobyda committed Aug 23, 2023
1 parent f788eb9 commit dc2abcb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/lib/cockpit-components-dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ DialogFooter.propTypes = {
* - id optional, id that is assigned to the top level dialog node, but not the backdrop
* - variant: See PF4 Modal component's 'variant' property
* - titleIconVariant: See PF4 Modal component's 'titleIconVariant' property
* - showClose optional, specifies if 'X' button for closing the dialog is present
*/
class Dialog extends React.Component {
componentDidMount() {
Expand Down Expand Up @@ -241,7 +242,7 @@ class Dialog extends React.Component {
<Modal position="top" variant={this.props.variant || "medium"}
titleIconVariant={this.props.titleIconVariant}
onEscapePress={() => undefined}
showClose={false}
showClose={!!this.props.showClose}
id={this.props.id}
isOpen
help={help}
Expand All @@ -264,6 +265,7 @@ Dialog.propTypes = {
footer: PropTypes.element, // is effectively required, see above
id: PropTypes.string,
error: PropTypes.object,
showClose: PropTypes.bool,
};

/* Create and show a dialog
Expand Down

0 comments on commit dc2abcb

Please sign in to comment.