From 054de55b11bf85c06fe9e23108efca78cefc56a9 Mon Sep 17 00:00:00 2001 From: Kerem Yilmaz Date: Wed, 2 Oct 2024 07:45:05 -0700 Subject: [PATCH] Move navigation payload to base content (#894) --- .../routes/tasks/create/CreateNewTaskForm.tsx | 92 ++++++++++++------ .../src/routes/tasks/create/SavedTaskForm.tsx | 97 ++++++++++++------- 2 files changed, 124 insertions(+), 65 deletions(-) diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx index 1e7a3c2b..7f3696ca 100644 --- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx +++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx @@ -87,6 +87,7 @@ function CreateNewTaskForm({ initialValues }: Props) { const [section, setSection] = useState<"base" | "extraction" | "advanced">( "base", ); + const [showAdvancedBaseContent, setShowAdvancedBaseContent] = useState(false); const form = useForm({ resolver: zodResolver(createNewTaskFormSchema), @@ -233,6 +234,67 @@ function CreateNewTaskForm({ initialValues }: Props) { )} /> + {showAdvancedBaseContent ? ( +
+ ( + +
+ +
+

Navigation Payload

+

+ Specify important parameters, routes, or + states +

+
+ +
+
+ + + + +
+
+
+ )} + /> +
+ ) : ( +
+ +
+ )} )} @@ -331,36 +393,6 @@ function CreateNewTaskForm({ initialValues }: Props) { {section === "advanced" && (
- ( - -
- -
-

Navigation Payload

-

- Specify important parameters, routes, or states -

-
-
-
- - - - -
-
-
- )} - /> ( "base", ); + const [showAdvancedBaseContent, setShowAdvancedBaseContent] = useState(false); const form = useForm({ resolver: zodResolver(savedTaskFormSchema), @@ -398,6 +399,67 @@ function SavedTaskForm({ initialValues }: Props) { )} /> + {showAdvancedBaseContent ? ( +
+ ( + +
+ +
+

Navigation Payload

+

+ Specify important parameters, routes, or + states +

+
+ +
+
+ + + + +
+
+
+ )} + /> +
+ ) : ( +
+ +
+ )}
)} @@ -497,41 +559,6 @@ function SavedTaskForm({ initialValues }: Props) { {section === "advanced" && (
- ( - -
- -
-

Navigation Payload

-

- Specify important parameters, routes, or states -

-
-
-
- - - - -
-
-
- )} - />