Skip to content

Commit efbc382

Browse files
Merge branch 'main' into export
2 parents b813947 + fccebb7 commit efbc382

File tree

4 files changed

+42
-16
lines changed

4 files changed

+42
-16
lines changed

client/package-lock.json

Lines changed: 8 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"socket.io-client": "^4.8.1",
2626
"sonner": "^2.0.7",
2727
"tailwind-merge": "^3.3.1",
28-
"tailwindcss": "^4.1.14"
28+
"tailwindcss": "^4.1.14",
29+
"tinycolor2": "^1.6.0"
2930
},
3031
"devDependencies": {
3132
"@eslint/js": "^9.36.0",

client/src/components/Canvas.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,4 +729,4 @@ export const Canvas = () => {
729729
</div>
730730
</div>
731731
);
732-
};
732+
};

client/src/components/ui/DropdownMenu.jsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,32 @@ export const DropdownMenu = ({ trigger, children }) => {
2121
};
2222
}, [isOpen]);
2323

24+
// Wrap children to automatically close on click
25+
const enhancedChildren =
26+
children &&
27+
Array.isArray(children)
28+
? children.map((child) =>
29+
child.props && child.props.onClick
30+
? {
31+
...child,
32+
props: {
33+
...child.props,
34+
onClick: (e) => {
35+
child.props.onClick(e);
36+
setIsOpen(false); // close dropdown
37+
},
38+
},
39+
}
40+
: child
41+
)
42+
: children;
43+
2444
return (
2545
<div className="relative" ref={dropdownRef}>
2646
<div onClick={() => setIsOpen(!isOpen)}>{trigger}</div>
2747
{isOpen && (
2848
<div className="absolute top-full mt-2 right-0 bg-white border border-toolbar-border rounded-lg shadow-xl backdrop-blur-sm min-w-[160px] z-50 overflow-hidden">
29-
{children}
49+
{enhancedChildren}
3050
</div>
3151
)}
3252
</div>
@@ -38,11 +58,19 @@ export const DropdownMenuItem = ({ onClick, children, className }) => {
3858
<button
3959
onClick={onClick}
4060
className={cn(
41-
"w-full px-4 py-2 text-left text-sm hover:bg-secondary transition-colors duration-150 flex items-center gap-2",
61+
"w-full px-4 py-2 text-left text-sm flex items-center gap-2 rounded-md transition-all duration-150",
62+
"hover:bg-secondary/20 hover:scale-105",
63+
"focus:outline-none focus:bg-secondary/30",
4264
className
4365
)}
4466
>
45-
{children}
67+
{/* If there is an SVG (stroke preview), change stroke color on hover */}
68+
{children && (
69+
<div className="flex items-center gap-2 group">
70+
{children}
71+
</div>
72+
)}
4673
</button>
4774
);
4875
};
76+

0 commit comments

Comments
 (0)