1
0
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:
George Marshall 2021-11-24 14:15:10 -08:00 committed by GitHub
parent d5ba78f90f
commit 1523b2353d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;