From c7ba506782bd9cb094f2f0175aa69014143678b4 Mon Sep 17 00:00:00 2001 From: Feenix <25067102+NayamAmarshe@users.noreply.github.com> Date: Tue, 15 Nov 2022 20:24:06 +0530 Subject: [PATCH] Added isVideo --- renderer/components/LeftPaneSteps.tsx | 88 ++++++++++++++++++++------- 1 file changed, 66 insertions(+), 22 deletions(-) diff --git a/renderer/components/LeftPaneSteps.tsx b/renderer/components/LeftPaneSteps.tsx index f456b72..d81f625 100644 --- a/renderer/components/LeftPaneSteps.tsx +++ b/renderer/components/LeftPaneSteps.tsx @@ -2,9 +2,45 @@ import React from "react"; import Select from "react-select"; import ReactTooltip from "react-tooltip"; -function LeftPaneSteps(props) { +interface IProps { + progress: string; + selectImageHandler: () => Promise; + selectFolderHandler: () => Promise; + handleModelChange: (e: any) => void; + handleDrop: (e: any) => void; + outputHandler: () => Promise; + upscaylHandler: () => Promise; + batchMode: boolean; + setBatchMode: (arg: any) => void; + imagePath: string; + outputPath: string; + doubleUpscayl: boolean; + setDoubleUpscayl: (arg: boolean) => void; + model: string; + isVideo: boolean; + setIsVideo: (arg: boolean) => void; +} + +function LeftPaneSteps({ + progress, + selectImageHandler, + selectFolderHandler, + handleModelChange, + handleDrop, + outputHandler, + upscaylHandler, + batchMode, + setBatchMode, + imagePath, + outputPath, + doubleUpscayl, + setDoubleUpscayl, + model, + isVideo, + setIsVideo, +}: IProps) { const handleBatchMode = () => { - props.setBatchMode((oldValue) => !oldValue); + setBatchMode((oldValue) => !oldValue); }; const customStyles = { @@ -36,8 +72,20 @@ function LeftPaneSteps(props) {

Image

- - + setIsVideo(false)} + /> + setIsVideo(true)} + />

Video

@@ -57,17 +105,13 @@ function LeftPaneSteps(props) {
{/* STEP 1 */} -
+

Step 1

@@ -82,30 +126,30 @@ function LeftPaneSteps(props) { IndicatorSeparator: () => null, DropdownIndicator: () => null, }} - onChange={props.handleModelChange} + onChange={handleModelChange} className="react-select-container" classNamePrefix="react-select" defaultValue={modelOptions[0]} /> - {props.model !== "models-DF2K" && !props.batchMode && ( + {model !== "models-DF2K" && !batchMode && (
{ if (e.target.checked) { - props.setDoubleUpscayl(true); + setDoubleUpscayl(true); } else { - props.setDoubleUpscayl(false); + setDoubleUpscayl(false); } }} />

{ - props.setDoubleUpscayl(!props.doubleUpscayl); + setDoubleUpscayl(!doubleUpscayl); }} > Double Upscayl @@ -121,10 +165,10 @@ function LeftPaneSteps(props) {

{/* STEP 3 */} -
+

Step 3

Defaults to Image's path

-
@@ -145,10 +189,10 @@ function LeftPaneSteps(props) {

Step 4