Skip to content

Commit

Permalink
Update ConfirmationModal prop types/documentation (#2193)
Browse files Browse the repository at this point in the history
* Update ConfirmationModal button prop types

The code expects a `node` prop type on these two labels; additionally, the code itself defaults to `<FormattedMessage>` nodes.

* Update heading type, too.

* Revert README change

* Update ConfirmationModal heading propType

* Document undocumented style props

---------

Co-authored-by: John Coburn <[email protected]>
  • Loading branch information
ncovercash and JohnC-80 authored Jan 5, 2024
1 parent 3454432 commit d6782f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ConfirmationModal/ConfirmationModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const propTypes = {
cancelButtonStyle: PropTypes.string,
cancelLabel: PropTypes.node,
confirmLabel: PropTypes.node,
heading: PropTypes.node.isRequired,
heading: PropTypes.string.isRequired,
id: PropTypes.string,
isConfirmButtonDisabled: PropTypes.bool,
message: PropTypes.oneOfType([
Expand Down
6 changes: 4 additions & 2 deletions lib/ConfirmationModal/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ Name | type | description | default | required
heading | string | String to appear as the modal's H1 tag. Doubles as the modal's ARIA-label | | &#10004;
message | node or array of nodes | Renderable content rendered within a `<p>` tag. | |
open | bool | Boolean reflecting modal's open/closed status | | &#10004;
cancelLabel | string | String to render on the Cancel action. | "Cancel" |
confirmLabel | string | String to render on the Submit action. | "Submit" |
cancelLabel | node | String to render on the Cancel action. | "Cancel" |
confirmLabel | node | String to render on the Submit action. | "Submit" |
buttonStyle | [button style](https://github.com/folio-org/stripes-components/tree/master/lib/Button#colors) | Style of the Submit action button. | `primary` |
cancelButtonStyle | [button style](https://github.com/folio-org/stripes-components/tree/master/lib/Button#colors) | Style of the Cancel action button. | `default` |
onConfirm | func | Callback fired when the Submit button is clicked | | &#10004;
onCancel | func | Callback fired when the Cancel button is clicked | | &#10004;
bodyTag | string | String to set the HTML tag used to wrap the modal message | "p" |
Expand Down

0 comments on commit d6782f1

Please sign in to comment.