Skip to content

Commit 257f521

Browse files
authored
Add className prop to confirmation modal (#555)
1 parent b4c5074 commit 257f521

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## react-components 5.33.1 (2022-03-10)
2+
3+
- [ConfirmationModal] Add className prop to confirmation modal (by [@Lukeaber](https://github.com/Lukeaber) in [#555](https://github.com/puppetlabs/design-system/pull/555))
14
## react-components 5.33.2 (2022-03-09)
25

36
- [Icon] Add Play icon

packages/react-components/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-components/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@puppet/react-components",
3-
"version": "5.33.2",
3+
"version": "5.33.3",
44
"author": "Puppet, Inc.",
55
"license": "Apache-2.0",
66
"main": "build/library.js",

packages/react-components/source/react/library/confirmation-modal/ConfirmationModal.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import classnames from 'classnames';
34
import Modal from '../modal';
45
import Button from '../button';
56

@@ -24,6 +25,8 @@ const propTypes = {
2425
onCancel: PropTypes.func,
2526
/** If true, confirm button will render with a loading spinner */
2627
confirmButtonLoading: PropTypes.bool,
28+
/** Additional classes to add in addition to 'rc-modal' */
29+
className: PropTypes.string,
2730
};
2831
const defaultProps = {
2932
title: '',
@@ -36,6 +39,7 @@ const defaultProps = {
3639
onConfirm: () => {},
3740
onCancel: () => {},
3841
confirmButtonLoading: false,
42+
className: '',
3943
};
4044

4145
const ConfirmationModal = ({
@@ -49,8 +53,13 @@ const ConfirmationModal = ({
4953
onConfirm,
5054
onCancel,
5155
confirmButtonLoading,
56+
className,
5257
}) => (
53-
<Modal onClose={onCancel} isOpen={isOpen}>
58+
<Modal
59+
className={classnames('rc-confirmation-modal', className)}
60+
onClose={onCancel}
61+
isOpen={isOpen}
62+
>
5463
{title && <Modal.Title>{title}</Modal.Title>}
5564
{description}
5665
<Modal.Actions>

0 commit comments

Comments
 (0)