mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
1 parent
dd81a4750a
commit
98e0bef1b7
1 file changed
+4
-2
@@ -33,7 +33,7 @@ import { HotbarSelector } from "./hotbar-selector";
|
|||||||
import { HotbarCell } from "./hotbar-cell";
|
import { HotbarCell } from "./hotbar-cell";
|
||||||
import { HotbarIcon } from "./hotbar-icon";
|
import { HotbarIcon } from "./hotbar-icon";
|
||||||
import { defaultHotbarCells, HotbarItem } from "../../../common/hotbar-types";
|
import { defaultHotbarCells, HotbarItem } from "../../../common/hotbar-types";
|
||||||
import { makeObservable, observable } from "mobx";
|
import { action, makeObservable, observable } from "mobx";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
className?: IClassName;
|
className?: IClassName;
|
||||||
@@ -62,10 +62,12 @@ export class HotbarMenu extends React.Component<Props> {
|
|||||||
return catalogEntityRegistry.getById(item?.entity.uid) ?? null;
|
return catalogEntityRegistry.getById(item?.entity.uid) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
onDragStart() {
|
onDragStart() {
|
||||||
this.draggingOver = true;
|
this.draggingOver = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
onDragEnd(result: DropResult) {
|
onDragEnd(result: DropResult) {
|
||||||
const { source, destination } = result;
|
const { source, destination } = result;
|
||||||
|
|
||||||
@@ -181,7 +183,7 @@ export class HotbarMenu extends React.Component<Props> {
|
|||||||
return (
|
return (
|
||||||
<div className={cssNames("HotbarMenu flex column", { draggingOver: this.draggingOver }, className)}>
|
<div className={cssNames("HotbarMenu flex column", { draggingOver: this.draggingOver }, className)}>
|
||||||
<div className="HotbarItems flex column gaps">
|
<div className="HotbarItems flex column gaps">
|
||||||
<DragDropContext onDragStart={this.onDragStart.bind(this)} onDragEnd={this.onDragEnd.bind(this)}>
|
<DragDropContext onDragStart={() => this.onDragStart()} onDragEnd={(result) => this.onDragEnd(result)}>
|
||||||
{this.renderGrid()}
|
{this.renderGrid()}
|
||||||
</DragDropContext>
|
</DragDropContext>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user