1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-20 13:57:23 +03:00

hotbar icon status led (#2651)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Jari Kolehmainen 2021-04-28 11:25:16 +03:00 committed by GitHub
parent ce27d704ae
commit 1e1cbd3333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 6 deletions

View File

@ -24,6 +24,23 @@
} }
} }
> .led {
position: absolute;
left: 3px;
top: 3px;
background-color: var(--layoutBackground);
border: 1px solid var(--clusterMenuBackground);
border-radius: 50%;
padding: 0px;
width: 8px;
height: 8px;
&.online {
background-color: var(--primary);
box-shadow: 0 0 5px var(--clusterMenuBackground), 0 0 5px var(--primary);
}
}
.badge { .badge {
position: absolute; position: absolute;
right: -2px; right: -2px;
@ -34,14 +51,10 @@
color: white; color: white;
padding: 0px; padding: 0px;
border-radius: 50%; border-radius: 50%;
border: 3px solid var(--clusterMenuBackground); border: 2px solid var(--clusterMenuBackground);
width: 15px; width: 15px;
height: 15px; height: 15px;
&.online {
background-color: #44b700;
}
svg { svg {
width: 13px; width: 13px;
} }

View File

@ -67,7 +67,7 @@ export class HotbarIcon extends React.Component<Props> {
} }
get kindIcon() { get kindIcon() {
const className = cssNames("badge", { online: this.props.entity.status.phase == "connected"}); const className = "badge";
const category = catalogCategoryRegistry.getCategoryForEntity(this.props.entity); const category = catalogCategoryRegistry.getCategoryForEntity(this.props.entity);
if (!category) { if (!category) {
@ -81,6 +81,12 @@ export class HotbarIcon extends React.Component<Props> {
} }
} }
get ledIcon() {
const className = cssNames("led", { online: this.props.entity.status.phase == "connected"}); // TODO: make it more generic
return <div className={className} />;
}
toggleMenu() { toggleMenu() {
this.menuOpen = !this.menuOpen; this.menuOpen = !this.menuOpen;
} }
@ -142,6 +148,7 @@ export class HotbarIcon extends React.Component<Props> {
> >
{this.iconString} {this.iconString}
</Avatar> </Avatar>
{ this.ledIcon }
{ this.kindIcon } { this.kindIcon }
<Menu <Menu
usePortal usePortal