improve forms by adding select and float inputs
performance fix
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user