Fix environment color editing

This commit is contained in:
Gregory Schier
2025-06-07 19:32:23 -07:00
parent 1abe01aa5a
commit 423a1a0a52
5 changed files with 23 additions and 25 deletions

View File

@@ -11,16 +11,22 @@ export function EnvironmentColorPicker({
}) {
const [color, setColor] = useState<string | null>(defaultColor);
return (
<div className="flex flex-col items-stretch gap-3 pb-2 w-full">
<form
className="flex flex-col items-stretch gap-3 pb-2 w-full"
onSubmit={(e) => {
e.preventDefault();
onChange(color);
}}
>
<ColorPicker color={color} onChange={setColor} />
<div className="grid grid-cols-[1fr_1fr] gap-1.5">
<Button variant="border" color="secondary" onClick={() => onChange(null)}>
Clear
</Button>
<Button color="primary" onClick={() => onChange(color)}>
<Button type="submit" color="primary">
Save
</Button>
</div>
</div>
</form>
);
}