From 21a8f62dccfd3647605d41f6c26244b853c59cad Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Wed, 9 Dec 2020 14:28:32 +0000 Subject: [PATCH 1/2] Styled viewport controls & cli copy --- .../lazy-app/Compress/Options/index.tsx | 20 ++- .../lazy-app/Compress/Options/style.css | 25 ++++ src/client/lazy-app/Compress/Output/index.tsx | 121 +++++++++--------- src/client/lazy-app/Compress/Output/style.css | 84 ++++++------ src/client/lazy-app/Compress/index.tsx | 25 ++++ src/client/lazy-app/icons/index.tsx | 11 ++ src/client/lazy-app/util/cli.ts | 51 ++++++++ src/shared/prerendered-app/Intro/index.tsx | 6 + src/shared/prerendered-app/Intro/style.css | 16 ++- 9 files changed, 250 insertions(+), 109 deletions(-) create mode 100644 src/client/lazy-app/util/cli.ts diff --git a/src/client/lazy-app/Compress/Options/index.tsx b/src/client/lazy-app/Compress/Options/index.tsx index 5208775d..d9c2bf3d 100644 --- a/src/client/lazy-app/Compress/Options/index.tsx +++ b/src/client/lazy-app/Compress/Options/index.tsx @@ -13,11 +13,11 @@ import { encoderMap, } from '../../feature-meta'; import Expander from './Expander'; -import Checkbox from './Checkbox'; import Toggle from './Toggle'; import Select from './Select'; import { Options as QuantOptionsComponent } from 'features/processors/quantize/client'; import { Options as ResizeOptionsComponent } from 'features/processors/resize/client'; +import { CLIIcon } from 'client/lazy-app/icons'; interface Props { index: 0 | 1; @@ -28,6 +28,7 @@ interface Props { onEncoderTypeChange(index: 0 | 1, newType: OutputType): void; onEncoderOptionsChange(index: 0 | 1, newOptions: EncoderOptions): void; onProcessorOptionsChange(index: 0 | 1, newOptions: ProcessorState): void; + onCopyCliClick(index: 0 | 1): void; } interface State { @@ -106,6 +107,10 @@ export default class Options extends Component { this.props.onEncoderOptionsChange(this.props.index, newOptions); }; + private onCopyCliClick = () => { + this.props.onCopyCliClick(this.props.index); + }; + render( { source, encoderState, processorState }: Props, { supportedEncoderMap }: State, @@ -125,7 +130,18 @@ export default class Options extends Component { {!encoderState ? null : (
-

Edit

+

+
+ Edit + +
+