Large compress select

This commit is contained in:
Jake Archibald
2018-10-18 17:59:07 +01:00
parent 2e65f8ad73
commit 16b59651fc
3 changed files with 25 additions and 6 deletions

View File

@@ -1,14 +1,18 @@
import { h, Component } from 'preact';
import * as style from './style.scss';
interface Props extends JSX.HTMLAttributes {}
interface Props extends JSX.HTMLAttributes {
large?: boolean;
}
interface State {}
export default class Select extends Component<Props, State> {
render(props: Props) {
const { large, ...otherProps } = props;
return (
<div class={style.select}>
<select class={style.nativeSelect} {...props}/>
<select class={`${style.nativeSelect} ${large ? style.large : ''}`} {...otherProps}/>
<svg class={style.arrow} viewBox="0 0 10 5"><path d="M0 0l5 5 5-5z"/></svg>
</div>
);