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

@@ -40,6 +40,7 @@ import { DownloadIcon } from '../../lib/icons';
import { SourceImage } from '../App'; import { SourceImage } from '../App';
import Checkbox from '../checkbox'; import Checkbox from '../checkbox';
import Expander from '../expander'; import Expander from '../expander';
import Select from '../select';
const encoderOptionsComponentMap = { const encoderOptionsComponentMap = {
[identity.type]: undefined, [identity.type]: undefined,
@@ -177,18 +178,23 @@ export default class Options extends Component<Props, State> {
: null} : null}
</Expander> </Expander>
{/*<section class={style.picker}> <h2 class={style.optionsTitle}>Compress</h2>
<section class={`${style.optionOneCell} ${style.optionsSection}`}>
{encoderSupportMap ? {encoderSupportMap ?
<select value={encoderState.type} onChange={this.onEncoderTypeChange}> <Select value={encoderState.type} onChange={this.onEncoderTypeChange} large>
{encoders.filter(encoder => encoderSupportMap[encoder.type]).map(encoder => ( {encoders.filter(encoder => encoderSupportMap[encoder.type]).map(encoder => (
<option value={encoder.type}>{encoder.label}</option> <option value={encoder.type}>{encoder.label}</option>
))} ))}
</select> </Select>
: :
<select><option>Loading…</option></select> <Select large><option>Loading</option></Select>
} }
</section> </section>
{/*
{EncoderOptionComponent && {EncoderOptionComponent &&
<EncoderOptionComponent <EncoderOptionComponent
options={ options={

View File

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

View File

@@ -22,3 +22,12 @@
fill: #fff; fill: #fff;
width: 10px; width: 10px;
} }
.large {
padding: 10px 35px 10px 10px;
background: #151515;
& .arrow {
right: 13px;
}
}