X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fcommon%2FToggleSwitch.js;fp=resources%2Fjs%2Fcomponents%2Fcommon%2FToggleSwitch.js;h=db07619ffd70a68ce7b8810c050975436289f1b8;hb=73c29bf37f10df401d87d14cc26999f88ce77379;hp=da9653c57d451c53527a1b79d1af9d56d54911ea;hpb=2ba39c5f4632579146d2663d82149a156a4e96c1;p=alttp.git diff --git a/resources/js/components/common/ToggleSwitch.js b/resources/js/components/common/ToggleSwitch.js index da9653c..db07619 100644 --- a/resources/js/components/common/ToggleSwitch.js +++ b/resources/js/components/common/ToggleSwitch.js @@ -12,6 +12,7 @@ const ToggleSwitch = ({ onChange, onLabel, readonly, + title, value, }) => { const toggle = () => { @@ -43,6 +44,7 @@ const ToggleSwitch = ({ role="button" aria-pressed={value} tabIndex="0" + title={title} onBlur={onBlur ? () => onBlur({ target: { name, value } }) : null} onClick={handleClick} onKeyDown={handleKey} @@ -68,6 +70,7 @@ ToggleSwitch.propTypes = { onChange: PropTypes.func, onLabel: PropTypes.string, readonly: PropTypes.bool, + title: PropTypes.string, value: PropTypes.bool, }; @@ -81,6 +84,7 @@ ToggleSwitch.defaultProps = { onChange: null, onLabel: '', readonly: false, + title: null, value: false, };