mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add ability to rename hotbars (#3469)
Signed-off-by: vshakirova <vshakirova@mirantis.com>
This commit is contained in:
1 parent
f507ec9e6c
commit
1b11433bca
6 files changed
+147
-4
No files matched your search
@@ -28,11 +28,13 @@ import { CommandOverlay } from "../command-palette";
|
||||
import { HotbarAddCommand } from "./hotbar-add-command";
|
||||
import { HotbarRemoveCommand } from "./hotbar-remove-command";
|
||||
import { hotbarDisplayLabel } from "./hotbar-display-label";
|
||||
import { HotbarRenameCommand } from "./hotbar-rename-command";
|
||||
|
||||
@observer
|
||||
export class HotbarSwitchCommand extends React.Component {
|
||||
private static addActionId = "__add__";
|
||||
private static removeActionId = "__remove__";
|
||||
private static renameActionId = "__rename__";
|
||||
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
@@ -51,11 +53,13 @@ export class HotbarSwitchCommand extends React.Component {
|
||||
options.push({ value: HotbarSwitchCommand.removeActionId, label: "Remove hotbar ..." });
|
||||
}
|
||||
|
||||
options.push({ value: HotbarSwitchCommand.renameActionId, label: "Rename hotbar ..." });
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
onChange(idOrAction: string): void {
|
||||
switch(idOrAction) {
|
||||
switch (idOrAction) {
|
||||
case HotbarSwitchCommand.addActionId:
|
||||
CommandOverlay.open(<HotbarAddCommand />);
|
||||
|
||||
@@ -63,6 +67,10 @@ export class HotbarSwitchCommand extends React.Component {
|
||||
case HotbarSwitchCommand.removeActionId:
|
||||
CommandOverlay.open(<HotbarRemoveCommand />);
|
||||
|
||||
return;
|
||||
case HotbarSwitchCommand.renameActionId:
|
||||
CommandOverlay.open(<HotbarRenameCommand />);
|
||||
|
||||
return;
|
||||
default:
|
||||
HotbarStore.getInstance().activeHotbarId = idOrAction;
|
||||
|
||||
Reference in new issue
Block a user