Revealing sections

This commit is contained in:
Jake Archibald
2018-10-17 12:04:04 +01:00
parent 6ec0349f8f
commit 2138154ec5
8 changed files with 179 additions and 55 deletions

View 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>
);
}
}