From 1ee994e42d512e48af63af1c64f24e1b394c3af1 Mon Sep 17 00:00:00 2001 From: Rushi Vishavadia Date: Sun, 21 Aug 2022 13:49:33 +0530 Subject: [PATCH] #167 Allow switches to have classnames --- src/components/Forms/Switch.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Forms/Switch.jsx b/src/components/Forms/Switch.jsx index 80de88386..a9696c1da 100644 --- a/src/components/Forms/Switch.jsx +++ b/src/components/Forms/Switch.jsx @@ -21,25 +21,27 @@ const sizes = { }, }; -// TODO: Native checkbox input `checked` and `disabled` properties are not prefixed with `is`. -// Decide on the naming convention. -export const Switch = ({ isChecked = false, size = "medium", ...rest }) => { +export const Switch = ({ isChecked = false, size = "medium", classNames = { parent: "", inner: "" }, ...rest }) => { return ( @@ -49,6 +51,7 @@ export const Switch = ({ isChecked = false, size = "medium", ...rest }) => { Switch.propTypes = { isChecked: PropTypes.bool, size: PropTypes.string, + classNames: PropTypes.shape({ switch: PropTypes.string, content: PropTypes.string }), }; Switch.Group = ({ className, children }) => {