mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-19 18:02:13 +00:00
extract used props is Checkbox
This commit is contained in:
parent
24a1600918
commit
3912b596cb
1 changed files with 4 additions and 4 deletions
|
|
@ -4,18 +4,18 @@ const Icon = require('stremio-icons/dom');
|
|||
const Button = require('stremio/common/Button');
|
||||
const styles = require('./styles');
|
||||
|
||||
const Checkbox = React.forwardRef((props, ref) => {
|
||||
const Checkbox = React.forwardRef(({ className, checked, children, ...props }, ref) => {
|
||||
return (
|
||||
<Button {...props} ref={ref} className={classnames(props.className, styles['checkbox-container'], { 'checked': props.checked })}>
|
||||
<Button {...props} ref={ref} className={classnames(className, styles['checkbox-container'], { 'checked': checked })}>
|
||||
{
|
||||
props.checked ?
|
||||
checked ?
|
||||
<svg className={styles['icon']} viewBox={'0 0 100 100'}>
|
||||
<Icon x={'10'} y={'10'} width={'80'} height={'80'} icon={'ic_check'} />
|
||||
</svg>
|
||||
:
|
||||
<Icon className={styles['icon']} icon={'ic_box_empty'} />
|
||||
}
|
||||
{props.children}
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue