From 6ac4e427ee734a20d26d139a00922405533dc7aa Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Tue, 30 May 2023 10:21:26 -0300 Subject: [PATCH] Added stroke fix on Paste and Add Flow --- src/frontend/src/contexts/tabsContext.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index f8015a21e..172bc9ff4 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -278,7 +278,12 @@ export function TabsProvider({ children }: { children: ReactNode }) { sourceHandle, targetHandle, id, - className: "animate-pulse", + style: { stroke: "inherit" }, + className: + targetHandle.split("|")[0] === "Text" + ? "stroke-gray-800 dark:stroke-gray-300" + : "stroke-gray-900 dark:stroke-gray-200", + animated: targetHandle.split("|")[0] === "Text", selected: false, }, edges.map((e) => ({ ...e, selected: false })) @@ -294,8 +299,12 @@ export function TabsProvider({ children }: { children: ReactNode }) { const description = flow?.description ? flow.description : ""; if (data) { data.edges.forEach((edge) => { - edge.className = ""; - edge.style = { stroke: "#555555" }; + edge.style = { stroke: "inherit" }; + edge.className = + edge.targetHandle.split("|")[0] === "Text" + ? "stroke-gray-800 dark:stroke-gray-300" + : "stroke-gray-900 dark:stroke-gray-200"; + edge.animated = edge.targetHandle.split("|")[0] === "Text"; }); data.nodes.forEach((node) => { if (Object.keys(templates[node.data.type]["template"]).length > 0) {