Skip to content

Commit 1809079

Browse files
authored
Revert "chore: updated Root.tsx for navigation changes (#1705)" (#1707)
This reverts commit daf079b.
1 parent daf079b commit 1809079

File tree

1 file changed

+6
-54
lines changed
  • workspaces/redhat-resource-optimization/packages/app/src/components/Root

1 file changed

+6
-54
lines changed

workspaces/redhat-resource-optimization/packages/app/src/components/Root/Root.tsx

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import React, { PropsWithChildren, useState } from 'react';
17+
import React, { PropsWithChildren } from 'react';
1818
import { makeStyles } from '@material-ui/core';
1919
import HomeIcon from '@material-ui/icons/Home';
2020
import ExtensionIcon from '@material-ui/icons/Extension';
@@ -76,49 +76,6 @@ const Logo = (props: { isOpen?: boolean }) => {
7676
return logo;
7777
};
7878

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-
12279
const SidebarLogo = () => {
12380
const classes = useSidebarLogoStyles();
12481
const { isOpen } = useSidebarOpenState();
@@ -148,16 +105,11 @@ export const Root = ({ children }: PropsWithChildren<{}>) => (
148105
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
149106
{/* End global nav */}
150107
<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+
/>
161113
<SidebarItem
162114
icon={OrchestratorIcon}
163115
to="orchestrator"

0 commit comments

Comments
 (0)