|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -import React, { PropsWithChildren, useState } from 'react'; |
| 17 | +import React, { PropsWithChildren } from 'react'; |
18 | 18 | import { makeStyles } from '@material-ui/core'; |
19 | 19 | import HomeIcon from '@material-ui/icons/Home'; |
20 | 20 | import ExtensionIcon from '@material-ui/icons/Extension'; |
@@ -76,49 +76,6 @@ const Logo = (props: { isOpen?: boolean }) => { |
76 | 76 | return logo; |
77 | 77 | }; |
78 | 78 |
|
79 | | -const CollapsibleSubmenu = ({ |
80 | | - icon, |
81 | | - text, |
82 | | - children, |
83 | | -}: { |
84 | | - icon: React.ReactElement; |
85 | | - text: string; |
86 | | - children: React.ReactNode; |
87 | | -}) => { |
88 | | - const [isOpen, setIsOpen] = useState(false); |
89 | | - const { isOpen: sidebarOpen } = useSidebarOpenState(); |
90 | | - |
91 | | - return ( |
92 | | - <> |
93 | | - <div |
94 | | - onClick={() => setIsOpen(!isOpen)} |
95 | | - onKeyDown={e => { |
96 | | - if (e.key === 'Enter' || e.key === ' ') { |
97 | | - e.preventDefault(); |
98 | | - setIsOpen(!isOpen); |
99 | | - } |
100 | | - }} |
101 | | - role="button" |
102 | | - tabIndex={0} |
103 | | - style={{ |
104 | | - display: 'flex', |
105 | | - alignItems: 'center', |
106 | | - cursor: 'pointer', |
107 | | - padding: '16px 16px', |
108 | | - userSelect: 'none', |
109 | | - }} |
110 | | - > |
111 | | - {icon} |
112 | | - {sidebarOpen && <span style={{ marginLeft: 12, flex: 1 }}>{text}</span>} |
113 | | - {sidebarOpen && ( |
114 | | - <span style={{ fontSize: '12px' }}>{isOpen ? '▼' : '▶'}</span> |
115 | | - )} |
116 | | - </div> |
117 | | - {isOpen && <div style={{ marginLeft: 40 }}>{children}</div>} |
118 | | - </> |
119 | | - ); |
120 | | -}; |
121 | | - |
122 | 79 | const SidebarLogo = () => { |
123 | 80 | const classes = useSidebarLogoStyles(); |
124 | 81 | const { isOpen } = useSidebarOpenState(); |
@@ -148,16 +105,11 @@ export const Root = ({ children }: PropsWithChildren<{}>) => ( |
148 | 105 | <SidebarItem icon={CreateComponentIcon} to="create" text="Create..." /> |
149 | 106 | {/* End global nav */} |
150 | 107 | <SidebarDivider /> |
151 | | - <CollapsibleSubmenu |
152 | | - icon={<ResourceOptimizationIconOutlined />} |
153 | | - text="Cost management" |
154 | | - > |
155 | | - <SidebarItem |
156 | | - icon={ResourceOptimizationIconOutlined} |
157 | | - to="/redhat-resource-optimization" |
158 | | - text="Optimizations" |
159 | | - /> |
160 | | - </CollapsibleSubmenu> |
| 108 | + <SidebarItem |
| 109 | + icon={ResourceOptimizationIconOutlined} |
| 110 | + to="/redhat-resource-optimization" |
| 111 | + text="Optimizations" |
| 112 | + /> |
161 | 113 | <SidebarItem |
162 | 114 | icon={OrchestratorIcon} |
163 | 115 | to="orchestrator" |
|
0 commit comments