mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Adding className to togglebutton (#12838)
This commit is contained in:
parent
d5ba78f90f
commit
1523b2353d
@ -47,7 +47,7 @@ const colors = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const ToggleButton = (props) => {
|
const ToggleButton = (props) => {
|
||||||
const { value, onToggle, offLabel, onLabel, disabled } = props;
|
const { value, onToggle, offLabel, onLabel, disabled, className } = props;
|
||||||
|
|
||||||
const modifier = value ? 'on' : 'off';
|
const modifier = value ? 'on' : 'off';
|
||||||
|
|
||||||
@ -59,9 +59,14 @@ const ToggleButton = (props) => {
|
|||||||
onToggle(value);
|
onToggle(value);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
className={classnames('toggle-button', `toggle-button--${modifier}`, {
|
className={classnames(
|
||||||
'toggle-button--disabled': disabled,
|
'toggle-button',
|
||||||
})}
|
`toggle-button--${modifier}`,
|
||||||
|
{
|
||||||
|
'toggle-button--disabled': disabled,
|
||||||
|
},
|
||||||
|
className,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<ReactToggleButton
|
<ReactToggleButton
|
||||||
value={value}
|
value={value}
|
||||||
@ -87,6 +92,7 @@ ToggleButton.propTypes = {
|
|||||||
offLabel: PropTypes.string,
|
offLabel: PropTypes.string,
|
||||||
onLabel: PropTypes.string,
|
onLabel: PropTypes.string,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
className: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ToggleButton;
|
export default ToggleButton;
|
||||||
|
Loading…
Reference in New Issue
Block a user