"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/renderer/components/hotbar/hotbar-icon.tsx" between
lens-5.1.2.tar.gz and lens-5.1.3.tar.gz

About: Lens is a Kubernetes IDE.

hotbar-icon.tsx  (lens-5.1.2):hotbar-icon.tsx  (lens-5.1.3)
skipping to change at line 77 skipping to change at line 77
export const HotbarIcon = observer(({menuItems = [], size = 40, tooltip, ...prop s}: HotbarIconProps) => { export const HotbarIcon = observer(({menuItems = [], size = 40, tooltip, ...prop s}: HotbarIconProps) => {
const { uid, title, src, material, active, className, source, disabled, onMenu Open, onClick, children, ...rest } = props; const { uid, title, src, material, active, className, source, disabled, onMenu Open, onClick, children, ...rest } = props;
const id = `hotbarIcon-${uid}`; const id = `hotbarIcon-${uid}`;
const [menuOpen, setMenuOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false);
const toggleMenu = () => { const toggleMenu = () => {
setMenuOpen(!menuOpen); setMenuOpen(!menuOpen);
}; };
const renderIcon = () => { return (
return ( <div className={cssNames("HotbarIcon flex", className, { disabled, contextMe
<Avatar nuAvailable: menuItems.length > 0 })}>
{...rest} {tooltip && <Tooltip targetId={id}>{tooltip}</Tooltip>}
title={title} <div
colorHash={`${title}-${source}`} id={id}
className={cssNames(active ? "active" : "default", { interactive: !!onCl
ick })}
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: !!on
return ( Click })}
<div className={cssNames("HotbarIcon flex", className, { disabled, contextMe width={size}
nuAvailable: 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
usePortal usePortal
htmlFor={id} htmlFor={id}
className="HotbarIconMenu" className="HotbarIconMenu"
isOpen={menuOpen} isOpen={menuOpen}
toggleEvent="contextmenu" toggleEvent="contextmenu"
position={{right: true, bottom: true }} // FIXME: position does not work position={{right: true, bottom: true }} // FIXME: position does not work
open={() => { open={() => {
 End of changes. 2 change blocks. 
22 lines changed or deleted 18 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)