diff --git a/src/components/shop/upgrades/index.tsx b/src/components/shop/upgrades/index.tsx index 3369628..519e340 100644 --- a/src/components/shop/upgrades/index.tsx +++ b/src/components/shop/upgrades/index.tsx @@ -43,36 +43,43 @@ export default function Upgrades(props: HTMLProps) { }; return ( -
+ <>
setActive(null)} + {...props} + className={[props.className, classes.container].join(" ")} + ref={containerRef} >
UPGRADES_PER_ROW && - classes.expandable - )} + className={classes.upgrades} + ref={setAnchor} + onMouseLeave={() => setActive(null)} > - {Object.entries(activeUpgrades).map(([type, upgrades]) => - Object.entries(upgrades).map(([id, upgrade]) => ( - = upgrade.price} - onBuy={handleBuy} - setActive={setActive} - setCoords={setCoords} - /> - )) - )} +
UPGRADES_PER_ROW && + classes.expandable + )} + > + {Object.entries(activeUpgrades).map( + ([type, upgrades]) => + Object.entries(upgrades).map( + ([id, upgrade]) => ( + = upgrade.price} + onBuy={handleBuy} + setActive={setActive} + setCoords={setCoords} + /> + ) + ) + )} +
{active !== null && ( @@ -87,6 +94,6 @@ export default function Upgrades(props: HTMLProps) {

{data[active.type][active.id]?.description}

)} -
+ ); }