UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

27 lines 1.24 kB
import { jsx as _jsx } from "preact/jsx-runtime"; import { useState } from "preact/hooks"; import { APPBAR_HEIGHT } from "../../globals"; const MenuButton = ({ disabled, highlight, onClick, children, compact, activeSignal }) => { const [hover, setHover] = useState(false); return (_jsx("div", { style: { display: "flex", alignItems: "center", height: compact ? "100%" : APPBAR_HEIGHT, paddingLeft: 20, paddingRight: 20, whiteSpace: "nowrap", background: disabled ? undefined : hover ? "rgba(255, 255, 255, 0.1)" : highlight ? "rgba(255, 255, 255, 0.2)" : activeSignal?.value ? "rgba(255, 255, 255, 0.1)" : undefined, opacity: disabled ? 0.5 : 1, cursor: disabled ? undefined : "pointer" }, onClick: disabled ? undefined : onClick, onMouseEnter: disabled ? undefined : () => setHover(true), onMouseLeave: disabled ? undefined : () => setHover(false), children: children })); }; export default MenuButton; //# sourceMappingURL=MenuButton.js.map