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

Aligning hotbar and cluster avatar styles

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-09-09 12:27:34 +03:00
parent 549ee15f73
commit 03ffe899fe
6 changed files with 30 additions and 14 deletions

View File

@ -21,6 +21,7 @@
.ClusterManager { .ClusterManager {
--bottom-bar-height: 22px; --bottom-bar-height: 22px;
--hotbar-width: 75px;
display: grid; display: grid;
grid-template-areas: grid-template-areas:
@ -48,7 +49,7 @@
#lens-views { #lens-views {
position: absolute; position: absolute;
left: 0; left: 0;
top: 40px; // Move below top bar top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
display: flex; display: flex;

View File

@ -25,13 +25,8 @@
position: relative; position: relative;
text-align: center; text-align: center;
background: $clusterMenuBackground; background: $clusterMenuBackground;
padding-top: 28px; padding-top: 1px;
width: 75px; width: var(--hotbar-width);
.is-mac &:before {
content: "";
height: 4px; // extra spacing for mac-os "traffic-light" buttons
}
.HotbarItems { .HotbarItems {
--cellWidth: 40px; --cellWidth: 40px;

View File

@ -46,11 +46,20 @@
text-align: center; text-align: center;
} }
.cluster-name { .cluster-description {
display: flex;
align-items: center;
padding: 1.25rem; padding: 1.25rem;
}
.cluster-name {
word-break: break-word;
font-weight: bold; font-weight: bold;
font-size: 1.5rem;
word-break: break-all;
color: var(--textColorAccent); color: var(--textColorAccent);
display: -webkit-box;
/* Simulate text-overflow:ellipsis styles but for multiple text lines */
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
} }
} }

View File

@ -41,6 +41,7 @@ import { Apps } from "../+apps";
import * as routes from "../../../common/routes"; import * as routes from "../../../common/routes";
import { Config } from "../+config"; import { Config } from "../+config";
import { catalogEntityRegistry } from "../../api/catalog-entity-registry"; import { catalogEntityRegistry } from "../../api/catalog-entity-registry";
import { HotbarIcon } from "../hotbar/hotbar-icon";
interface Props { interface Props {
className?: string; className?: string;
@ -187,8 +188,17 @@ export class Sidebar extends React.Component<Props> {
return ( return (
<div className={cssNames(Sidebar.displayName, "flex column", className)}> <div className={cssNames(Sidebar.displayName, "flex column", className)}>
{this.clusterEntity && ( {this.clusterEntity && (
<div className="cluster-name"> <div className="cluster-description">
{this.clusterEntity.metadata.name} <HotbarIcon
uid={this.clusterEntity.metadata.uid}
title={this.clusterEntity.metadata.name}
source={this.clusterEntity.metadata.source}
src={this.clusterEntity.spec.icon?.src}
className="mr-5"
/>
<div className="cluster-name">
{this.clusterEntity.metadata.name}
</div>
</div> </div>
)} )}
<div className={cssNames("sidebar-nav flex column box grow-fixed")}> <div className={cssNames("sidebar-nav flex column box grow-fixed")}>

View File

@ -28,6 +28,7 @@
z-index: 1; z-index: 1;
width: 100%; width: 100%;
grid-area: topbar; grid-area: topbar;
padding-left: var(--hotbar-width);
} }
.history { .history {

View File

@ -95,7 +95,7 @@ export const TopBar = observer(({ children, ...rest }: Props) => {
<Icon <Icon
data-testid="home-button" data-testid="home-button"
material="home" material="home"
className="ml-5" className="ml-4"
onClick={goHome} onClick={goHome}
disabled={isActiveRoute(catalogRoute)} disabled={isActiveRoute(catalogRoute)}
/> />