mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allowing any item for StatusBarRegistration (#1143)
* Adding extension's label text next to Icon Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Removing unused registerStatusBarItem() Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
9b9bf47970
commit
e9ebd06664
@ -21,15 +21,17 @@ export default class SupportPageRendererExtension extends LensRendererExtension
|
||||
)
|
||||
}
|
||||
|
||||
registerStatusBarIcon(registry: Registry.StatusBarRegistry) {
|
||||
registerStatusBarItem(registry: Registry.StatusBarRegistry) {
|
||||
this.disposers.push(
|
||||
registry.add({
|
||||
icon: (
|
||||
<Component.Icon
|
||||
material="support"
|
||||
tooltip="Support"
|
||||
item: (
|
||||
<div
|
||||
className="flex align-center gaps hover-highlight"
|
||||
onClick={() => Navigation.navigate(supportPageURL())}
|
||||
/>
|
||||
>
|
||||
<Component.Icon material="help_outline" small />
|
||||
<span>Support</span>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
)
|
||||
|
||||
@ -47,7 +47,7 @@ export class ExtensionLoader {
|
||||
instance.registerGlobalPage(globalPageRegistry)
|
||||
instance.registerAppPreferences(appPreferenceRegistry)
|
||||
instance.registerClusterFeatures(clusterFeatureRegistry)
|
||||
instance.registerStatusBarIcon(statusBarRegistry)
|
||||
instance.registerStatusBarItem(statusBarRegistry)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
import { LensExtension } from "./lens-extension"
|
||||
import type { MenuRegistry } from "./registries/menu-registry";
|
||||
import type { StatusBarRegistry } from "./registries/status-bar-registry";
|
||||
|
||||
export class LensMainExtension extends LensExtension {
|
||||
registerAppMenus(registry: MenuRegistry) {
|
||||
//
|
||||
}
|
||||
|
||||
registerStatusBarIcon(registry: StatusBarRegistry) {
|
||||
//
|
||||
}
|
||||
|
||||
registerPrometheusProviders(registry: any) {
|
||||
//
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ export class LensRendererExtension extends LensExtension {
|
||||
return
|
||||
}
|
||||
|
||||
registerStatusBarIcon(registry: StatusBarRegistry) {
|
||||
registerStatusBarItem(registry: StatusBarRegistry) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import React from "react";
|
||||
import { BaseRegistry } from "./base-registry";
|
||||
|
||||
export interface StatusBarRegistration {
|
||||
icon?: React.ReactNode;
|
||||
item?: React.ReactNode;
|
||||
}
|
||||
|
||||
export class StatusBarRegistry extends BaseRegistry<StatusBarRegistration> {
|
||||
|
||||
@ -1,13 +1,27 @@
|
||||
.BottomBar {
|
||||
$spacing: $padding / 2;
|
||||
--flex-gap: #{$spacing};
|
||||
|
||||
font-size: $font-size-small;
|
||||
background-color: #3d90ce;
|
||||
padding: $padding / 4 $padding;
|
||||
padding: 0 $padding;
|
||||
color: white;
|
||||
|
||||
#current-workspace {
|
||||
--flex-gap: #{$spacing};
|
||||
padding: $padding / 4 $padding / 2;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hover-highlight {
|
||||
&:hover {
|
||||
background-color: #ffffff33;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.extensions {
|
||||
> * {
|
||||
padding: $padding / 4 $padding / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export class BottomBar extends React.Component {
|
||||
const { currentWorkspace } = workspaceStore;
|
||||
return (
|
||||
<div className="BottomBar flex gaps">
|
||||
<div id="current-workspace" className="flex gaps align-center">
|
||||
<div id="current-workspace" className="flex gaps align-center hover-highlight">
|
||||
<Icon small material="layers"/>
|
||||
<span className="workspace-name">{currentWorkspace.name}</span>
|
||||
</div>
|
||||
@ -21,9 +21,9 @@ export class BottomBar extends React.Component {
|
||||
htmlFor="current-workspace"
|
||||
/>
|
||||
<div className="extensions box grow flex gaps justify-flex-end">
|
||||
{statusBarRegistry.getItems().map(({ icon }, index) => {
|
||||
if (!icon) return;
|
||||
return <React.Fragment key={index}>{icon}</React.Fragment>
|
||||
{statusBarRegistry.getItems().map(({ item }, index) => {
|
||||
if (!item) return;
|
||||
return <React.Fragment key={index}>{item}</React.Fragment>
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user