Skip to content

Commit

Permalink
docs(Switch): add explicit disabled prop type (#6598)
Browse files Browse the repository at this point in the history
* docs(Switch): add explicit disabled prop type

* chore: update snapshots

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
emyarod and kodiakhq[bot] authored Jul 30, 2020
1 parent 1ddaec2 commit a18b82e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4555,6 +4555,9 @@ Map {
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"index": Object {
"type": "number",
},
Expand Down
7 changes: 7 additions & 0 deletions packages/react/src/components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const { prefix } = settings;
const Switch = React.forwardRef(function Switch(props, tabRef) {
const {
className,
disabled,
index,
name,
onClick,
Expand Down Expand Up @@ -43,6 +44,7 @@ const Switch = React.forwardRef(function Switch(props, tabRef) {
onClick: handleClick,
onKeyDown: handleKeyDown,
className: classes,
disabled,
};

return (
Expand All @@ -66,6 +68,11 @@ Switch.propTypes = {
*/
className: PropTypes.string,

/**
* Specify whether or not the Switch should be disabled
*/
disabled: PropTypes.bool,

/**
* The index of your Switch in your ContentSwitcher that is used for event handlers.
* Reserved for usage in ContentSwitcher
Expand Down

0 comments on commit a18b82e

Please sign in to comment.