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