Copy to side ui (#229)

* Copy settings to other side button

* Download button on the outside.

* Whoops
This commit is contained in:
Jake Archibald
2018-11-06 13:39:03 +00:00
committed by GitHub
parent d93169cc5a
commit 4599e51b1e
6 changed files with 110 additions and 47 deletions

View File

@@ -59,13 +59,11 @@ const encoderOptionsComponentMap = {
interface Props {
mobileView: boolean;
source?: SourceImage;
imageIndex: number;
encoderState: EncoderState;
preprocessorState: PreprocessorState;
onEncoderTypeChange(newType: EncoderType): void;
onEncoderOptionsChange(newOptions: EncoderOptions): void;
onPreprocessorOptionsChange(newOptions: PreprocessorState): void;
onCopyToOtherClick(): void;
}
interface State {
@@ -116,16 +114,9 @@ export default class Options extends Component<Props, State> {
);
}
@bind
onCopyToOtherClick(event: Event) {
event.preventDefault();
this.props.onCopyToOtherClick();
}
render(
{
source,
imageIndex,
encoderState,
preprocessorState,
onEncoderOptionsChange,
@@ -205,14 +196,6 @@ export default class Options extends Component<Props, State> {
/>
: null}
</Expander>
<div class={style.optionsCopy}>
<button onClick={this.onCopyToOtherClick} class={style.copyButton}>
{imageIndex === 1 && '← '}
Copy settings across
{imageIndex === 0 && ' →'}
</button>
</div>
</div>
);
}