mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 17:49:52 +00:00
Revealing sections
This commit is contained in:
20
src/components/checkbox/index.tsx
Normal file
20
src/components/checkbox/index.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { h, Component } from 'preact';
|
||||
import * as style from './style.scss';
|
||||
import { UncheckedIcon, CheckedIcon } from '../../lib/icons';
|
||||
|
||||
interface Props extends JSX.HTMLAttributes {}
|
||||
interface State {}
|
||||
|
||||
export default class Checkbox extends Component<Props, State> {
|
||||
render(props: Props) {
|
||||
return (
|
||||
<div class={style.checkbox}>
|
||||
{props.checked
|
||||
? <CheckedIcon class={`${style.icon} ${style.checked}`} />
|
||||
: <UncheckedIcon class={style.icon} />
|
||||
}
|
||||
<input class={style.realCheckbox} type="checkbox" {...props}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user