Skip to content

Commit

Permalink
fix(InlineNotification): make statusIconDescription optional (#5528)
Browse files Browse the repository at this point in the history
Given `statucIconDescription` in `<InlineNotification>` and one in
`<ToastNotification>` have a fallback value, they shouldn't have
`isRequired` in their prop types. This change fixes that.

Fixes #5527.
  • Loading branch information
asudoh authored Mar 10, 2020
1 parent 2fcc828 commit fde409c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3538,7 +3538,6 @@ Map {
"type": "bool",
},
"iconDescription": Object {
"isRequired": true,
"type": "string",
},
"kind": Object {
Expand Down Expand Up @@ -3567,7 +3566,6 @@ Map {
"type": "string",
},
"statusIconDescription": Object {
"isRequired": true,
"type": "string",
},
"subtitle": Object {
Expand Down Expand Up @@ -3604,7 +3602,6 @@ Map {
"type": "bool",
},
"iconDescription": Object {
"isRequired": true,
"type": "string",
},
"kind": Object {
Expand Down Expand Up @@ -3633,7 +3630,6 @@ Map {
"type": "string",
},
"statusIconDescription": Object {
"isRequired": true,
"type": "string",
},
"subtitle": Object {
Expand Down
8 changes: 4 additions & 4 deletions packages/react/src/components/Notification/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ ToastNotification.propTypes = {
/**
* Provide a description for "close" icon that can be read by screen readers
*/
iconDescription: PropTypes.string.isRequired,
iconDescription: PropTypes.string,

/**
* Provide a description for "status" icon that can be read by screen readers
*/
statusIconDescription: PropTypes.string.isRequired,
statusIconDescription: PropTypes.string,

/**
* By default, this value is "toast". You can also provide an alternate type
Expand Down Expand Up @@ -504,12 +504,12 @@ InlineNotification.propTypes = {
/**
* Provide a description for "close" icon that can be read by screen readers
*/
iconDescription: PropTypes.string.isRequired,
iconDescription: PropTypes.string,

/**
* Provide a description for "status" icon that can be read by screen readers
*/
statusIconDescription: PropTypes.string.isRequired,
statusIconDescription: PropTypes.string,

/**
* By default, this value is "inline". You can also provide an alternate type
Expand Down

0 comments on commit fde409c

Please sign in to comment.