]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/common/ToggleSwitch.js
remove some useless svg groups
[alttp.git] / resources / js / components / common / ToggleSwitch.js
index da9653c57d451c53527a1b79d1af9d56d54911ea..db07619ffd70a68ce7b8810c050975436289f1b8 100644 (file)
@@ -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,
 };