From 8e6c537d7657018eef6d6289591efbd20337c41a Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 3 Jul 2023 16:21:20 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(ApiModal/index.tsx):=20fix?= =?UTF-8?q?=20indentation=20and=20spacing=20issues=20for=20better=20code?= =?UTF-8?q?=20readability=20=E2=9C=A8=20feat(ApiModal/index.tsx):=20improv?= =?UTF-8?q?e=20UI=20by=20adjusting=20the=20layout=20and=20styling=20of=20t?= =?UTF-8?q?he=20modal=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/modals/ApiModal/index.tsx | 66 ++++++++++++---------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/src/frontend/src/modals/ApiModal/index.tsx b/src/frontend/src/modals/ApiModal/index.tsx index d796863a8..e767c0368 100644 --- a/src/frontend/src/modals/ApiModal/index.tsx +++ b/src/frontend/src/modals/ApiModal/index.tsx @@ -104,10 +104,11 @@ export default function ApiModal({ flow }: { flow: FlowType }) { useEffect(() => { if (closeEdit !== "") { tweak.current = getTweak; - if (tweak.current.length > 0) { + if(tweak.current.length > 0){ setActiveTab("3"); openAccordions(); - } else { + } + else{ startTweaks(); } } else { @@ -249,31 +250,34 @@ export default function ApiModal({ flow }: { flow: FlowType }) { function openAccordions() { let accordionsToOpen = []; - tweak.current.forEach((el) => { - Object.keys(el).forEach((key) => { - if (Object.keys(el[key]).length > 0) { - accordionsToOpen.push(key); - setOpenAccordion(accordionsToOpen); - } + tweak.current.forEach((el) => { + Object.keys(el).forEach((key) => { + if (Object.keys(el[key]).length > 0) { + accordionsToOpen.push(key); + setOpenAccordion(accordionsToOpen); + } + }); }); - }); } return ( - + Code - {EXPORT_CODE_DIALOG} { setActiveTab(value); if (value === "3") { @@ -289,21 +293,23 @@ export default function ApiModal({ flow }: { flow: FlowType }) { ))} -
- -
+ {Number(activeTab) < 3 && ( +
+ +
+ )} {tabs.map((tab, index) => ( {index < 3 ? ( @@ -316,10 +322,10 @@ export default function ApiModal({ flow }: { flow: FlowType }) { ) : index === 3 ? ( <> -
+
-
+
- + PARAM - + VALUE @@ -373,11 +379,11 @@ export default function ApiModal({ flow }: { flow: FlowType }) { key={i} className="h-10 dark:border-b-muted" > - + {n} - -
+ +
{t.data.node.template[n] .type === "str" && !t.data.node.template[n]