From c9d584d26fa5bf221013e0f949955e08dd4e8c50 Mon Sep 17 00:00:00 2001 From: Jenny <32821331+jenny-s51@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:29:02 -0400 Subject: [PATCH] refactor split and flex instances in favor of toolbar components --- .../topologyPackageDemo/OptionsContextBar.tsx | 111 +++++++++--------- .../content/examples/TopologyLayoutsDemo.tsx | 12 +- 2 files changed, 59 insertions(+), 64 deletions(-) diff --git a/packages/demo-app-ts/src/demos/topologyPackageDemo/OptionsContextBar.tsx b/packages/demo-app-ts/src/demos/topologyPackageDemo/OptionsContextBar.tsx index f82e6918..d7fb7c73 100644 --- a/packages/demo-app-ts/src/demos/topologyPackageDemo/OptionsContextBar.tsx +++ b/packages/demo-app-ts/src/demos/topologyPackageDemo/OptionsContextBar.tsx @@ -1,8 +1,6 @@ import React from 'react'; import { Button, - Flex, - FlexItem, MenuToggle, MenuToggleElement, Select, @@ -227,66 +225,65 @@ const OptionsContextBar: React.FC = observer(() => { }; return ( + <> Nodes: - - val ? updateValue(parseInt(val), 0, 9999, setNumNodes) : setNumNodes(null) - } - /> - > - Edges: - - - val ? updateValue(parseInt(val), 0, 200, setNumEdges) : setNumEdges(null) - } - /> - - Groups: - - val ? updateValue(parseInt(val), 0, 100, setNumGroups) : setNumGroups(null) - } - /> - - Nesting Depth: - - val ? updateValue(parseInt(val), 0, 5, setNestedLevel) : setNestedLevel(null) - } - /> - - - - - - + + val ? updateValue(parseInt(val), 0, 9999, setNumNodes) : setNumNodes(null) + } + /> + + Edges: + + + val ? updateValue(parseInt(val), 0, 200, setNumEdges) : setNumEdges(null) + } + /> + + Groups: + + + val ? updateValue(parseInt(val), 0, 100, setNumGroups) : setNumGroups(null) + } + /> + + Nesting Depth: + + + val ? updateValue(parseInt(val), 0, 5, setNestedLevel) : setNestedLevel(null) + } + /> + + + - - {renderNodeOptionsDropdown()} - {renderEdgeOptionsDropdown()} - + {renderNodeOptionsDropdown()} + {renderEdgeOptionsDropdown()} + ); }); diff --git a/packages/module/patternfly-docs/content/examples/TopologyLayoutsDemo.tsx b/packages/module/patternfly-docs/content/examples/TopologyLayoutsDemo.tsx index b236b8f1..6ac8bc7d 100644 --- a/packages/module/patternfly-docs/content/examples/TopologyLayoutsDemo.tsx +++ b/packages/module/patternfly-docs/content/examples/TopologyLayoutsDemo.tsx @@ -257,11 +257,9 @@ export const LayoutsDemo: React.FC = () => { }, [controller, layout]); const layoutDropdown = ( - - - - - + <> + Layout + ) => ( setLayoutDropdownOpen(!layoutDropdownOpen)}> @@ -317,8 +315,8 @@ export const LayoutsDemo: React.FC = () => { - - + + ); return (