1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Moving isActive check out of Droppable

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-05-05 11:58:43 +03:00
parent 70fe7be1a0
commit 96fd4921ec

View File

@ -57,6 +57,7 @@ export class HotbarMenu extends React.Component<Props> {
renderGrid() {
return this.hotbar.items.map((item, index) => {
const entity = this.getEntity(item);
const isActive = !entity ? false : this.isActive(entity);
return (
<Droppable droppableId={`${index}`} key={index}>
@ -92,7 +93,7 @@ export class HotbarMenu extends React.Component<Props> {
key={index}
index={index}
entity={entity}
isActive={this.isActive(entity)}
isActive={isActive}
onClick={() => entity.onRun(catalogEntityRunContext)}
className={cssNames({ isDragging: snapshot.isDragging })}
/>