spread checked prop in ConsentCheckbox

This commit is contained in:
nklhrstv 2020-03-28 17:41:44 +02:00
parent e5e0bc8b38
commit 47c5665c32

View file

@ -4,7 +4,7 @@ const classnames = require('classnames');
const { Button, Checkbox } = require('stremio/common');
const styles = require('./styles');
const ConsentCheckbox = React.forwardRef(({ className, checked, label, link, href, onToggle, ...props }, ref) => {
const ConsentCheckbox = React.forwardRef(({ className, label, link, href, onToggle, ...props }, ref) => {
const checkboxOnClick = React.useCallback((event) => {
if (typeof props.onClick === 'function') {
props.onClick(event);
@ -22,7 +22,7 @@ const ConsentCheckbox = React.forwardRef(({ className, checked, label, link, hre
event.nativeEvent.togglePrevented = true;
}, []);
return (
<Checkbox {...props} ref={ref} className={classnames(className, styles['consent-checkbox-container'])} checked={checked} onClick={checkboxOnClick}>
<Checkbox {...props} ref={ref} className={classnames(className, styles['consent-checkbox-container'])} onClick={checkboxOnClick}>
<div className={styles['label']}>
{label}
{' '}