From 1796e349c24ee81610ba842ef53973ca511bdc79 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 21 Sep 2023 20:03:47 -0300 Subject: [PATCH] fix(nodeToolbarComponent): fix indentation and formatting issues in the code feat(nodeToolbarComponent): add support for minimal mode in the toolbar feat(nodeToolbarComponent): add functionality to show/hide advanced options in the toolbar --- .../components/nodeToolbarComponent/index.tsx | 96 +++++++++++-------- 1 file changed, 57 insertions(+), 39 deletions(-) diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 953b5d54f..e1e3bd5c4 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -46,7 +46,7 @@ export default function NodeToolbarComponent({ if (countHandles > 1) return false; return true; } - + const isMinimal = canMinimize(); const { paste } = useContext(TabsContext); const reactFlowInstance = useReactFlow(); const [showModalAdvanced, setShowModalAdvanced] = useState(false); @@ -131,49 +131,67 @@ export default function NodeToolbarComponent({ - + + +
+
+ +
- -
-
- - -
- {" "} - Edit{" "} -
{" "} -
- {canMinimize() && ( - + + + +
- {showNode ? "Minimize" : "Expand"} -
+ />{" "} + Edit{" "} + {" "}
- )} -
- + {isMinimal && ( + +
+ + {showNode ? "Minimize" : "Expand"} +
+
+ )} +
+ + ) : ( + +
+ +
+
+ )} {showModalAdvanced && (