mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix onRun not executing everywhere :hover is defined for HotbarIcon (#3316)
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
fe33296ba5
commit
d52c4c3999
@ -74,32 +74,28 @@ export const HotbarIcon = observer(({menuItems = [], size = 40, tooltip, ...prop
|
|||||||
setMenuOpen(!menuOpen);
|
setMenuOpen(!menuOpen);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderIcon = () => {
|
return (
|
||||||
return (
|
<div className={cssNames("HotbarIcon flex", className, { disabled, contextMenuAvailable: menuItems.length > 0 })}>
|
||||||
<Avatar
|
{tooltip && <Tooltip targetId={id}>{tooltip}</Tooltip>}
|
||||||
{...rest}
|
<div
|
||||||
title={title}
|
id={id}
|
||||||
colorHash={`${title}-${source}`}
|
|
||||||
className={cssNames(active ? "active" : "default", { interactive: !!onClick })}
|
|
||||||
width={size}
|
|
||||||
height={size}
|
|
||||||
src={src}
|
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
onClick?.(event);
|
onClick?.(event);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{material && <Icon className="materialIcon" material={material}/>}
|
<Avatar
|
||||||
</Avatar>
|
{...rest}
|
||||||
);
|
title={title}
|
||||||
};
|
colorHash={`${title}-${source}`}
|
||||||
|
className={cssNames(active ? "active" : "default", { interactive: !!onClick })}
|
||||||
return (
|
width={size}
|
||||||
<div className={cssNames("HotbarIcon flex", className, { disabled, contextMenuAvailable: menuItems.length > 0 })}>
|
height={size}
|
||||||
{tooltip && <Tooltip targetId={id}>{tooltip}</Tooltip>}
|
src={src}
|
||||||
<div id={id}>
|
>
|
||||||
{renderIcon()}
|
{material && <Icon className="materialIcon" material={material} />}
|
||||||
|
</Avatar>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
<Menu
|
<Menu
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user