Skip to content

Commit

Permalink
CORE-4661 swith disable (#647)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekachxaidze98 authored Nov 24, 2023
1 parent 0a019ce commit c4da377
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/elements/switch/switch.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@
margin-left: 1rem;
font-size: var(--label-font-size);
}

.non-active {
cursor: not-allowed;
}
3 changes: 3 additions & 0 deletions src/elements/switch/switch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const Switch = ({
name = id,
checked,
onChange,
// eslint-disable-next-line react/prop-types
nonActive = false,
label,
className,
...props
Expand All @@ -34,6 +36,7 @@ const Switch = ({
<label
className={classNames.use(useStyles(styles.box), {
[styles.active]: checked,
[styles.nonActive]: nonActive,
})}
htmlFor={name}
>
Expand Down

0 comments on commit c4da377

Please sign in to comment.