1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Removing sidebar compact view

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-05-26 11:07:27 +03:00
parent 16e50a7cb5
commit 7512b62dab
2 changed files with 3 additions and 14 deletions

View File

@ -23,7 +23,6 @@ import { createStorage } from "../../utils";
export interface SidebarStorageState { export interface SidebarStorageState {
width: number; width: number;
compact: boolean;
expanded: { expanded: {
[itemId: string]: boolean; [itemId: string]: boolean;
} }
@ -31,6 +30,5 @@ export interface SidebarStorageState {
export const sidebarStorage = createStorage<SidebarStorageState>("sidebar", { export const sidebarStorage = createStorage<SidebarStorageState>("sidebar", {
width: 200, // sidebar size in non-compact mode width: 200, // sidebar size in non-compact mode
compact: false, // compact-mode (icons only)
expanded: {}, expanded: {},
}); });

View File

@ -52,8 +52,6 @@ import { SidebarItem } from "./sidebar-item";
interface Props { interface Props {
className?: string; className?: string;
compact?: boolean; // compact-mode view: show only icons and expand on :hover
toggle(): void; // compact-mode updater
} }
@observer @observer
@ -173,24 +171,17 @@ export class Sidebar extends React.Component<Props> {
} }
render() { render() {
const { toggle, compact, className } = this.props; const { className } = this.props;
return ( return (
<div className={cssNames(Sidebar.displayName, "flex column", { compact }, className)}> <div className={cssNames(Sidebar.displayName, "flex column", className)}>
<div className="header flex align-center"> <div className="header flex align-center">
<NavLink exact to="/" className="box grow"> <NavLink exact to="/" className="box grow">
<Icon svg="logo-lens" className="logo-icon"/> <Icon svg="logo-lens" className="logo-icon"/>
<div className="logo-text">Lens</div> <div className="logo-text">Lens</div>
</NavLink> </NavLink>
<Icon
focusable={false}
className="pin-icon"
tooltip="Compact view"
material={compact ? "keyboard_arrow_right" : "keyboard_arrow_left"}
onClick={toggle}
/>
</div> </div>
<div className={cssNames("sidebar-nav flex column box grow-fixed", { compact })}> <div className={cssNames("sidebar-nav flex column box grow-fixed")}>
<SidebarItem <SidebarItem
id="cluster" id="cluster"
text="Cluster" text="Cluster"