improve forms by adding select and float inputs

performance fix
This commit is contained in:
2023-06-01 01:24:42 +02:00
parent ebb2408a68
commit fcd3afa3f2
21 changed files with 872 additions and 345 deletions

View File

@@ -1,29 +1,18 @@
import { PopoverContent, PopoverPortal } from "@radix-ui/react-popover";
import { Popover } from "components/Popover";
import { PopoverClose } from "components/Popover";
import { KeyframeProperties } from "components/Properties/Values";
import { Keyframe } from "primitives/Keyframe";
import { FC } from "react";
import { z } from "zod";
const KeyframePopover: FC<{
open: boolean;
keyframe: z.input<typeof Keyframe>;
onUpdate: (k: z.input<typeof Keyframe>) => void;
}> = ({ open, keyframe, onUpdate }) => {
onClose: () => void;
}> = ({ keyframe, onUpdate, onClose }) => {
return (
<div>
<Popover open={open}>
<PopoverContent>
<label>
<span className="label">Value</span>
<input
onChange={(e) =>
onUpdate({ ...keyframe, value: Number(e.target.value) })
}
value={keyframe.value}
/>
</label>
</PopoverContent>
</Popover>
<KeyframeProperties entity={keyframe} onUpdate={onUpdate} />
<PopoverClose onClick={onClose} />
</div>
);
};