fix types

This commit is contained in:
Oleg Isonen committed 2022-06-09 20:56:27 +02:00
1 parent d45a8268b7
commit eea856dc2a
4 files changed
+5948 -96

No files matched your search

@@ -33,7 +33,7 @@ const Property = ({ id, prop, value, onChange, onDelete }: PropertyProps) => {
variant="ghost"
placeholder="Value"
name="value"
value={value}
value={String(value)}
onChange={(event) => {
onChange(id, "value", event.target.value);
}}
@@ -82,11 +82,13 @@ export const usePropsLogic = ({
const handleChangeProp = (
id: UserProp["id"],
field: keyof UserProp,
value: string
value: UserProp["prop"] | UserProp["value"]
) => {
const index = userProps.findIndex((item) => item.id === id);
const nextUserProps = produce((draft: Array<UserProp>) => {
draft[index][field] = value;
if (field === "prop" && typeof value === "string") {
draft[index].prop = value;
} else draft[index].value = value;
})(userProps);
setUserProps(nextUserProps);
+2 -1
View File
@@ -47,7 +47,7 @@
"@remix-run/react": "^1.5.1",
"@remix-run/serve": "^1.5.1",
"@stitches/react": "^1.2.7",
"@webstudio-is/sdk": "0.3.1",
"@webstudio-is/sdk": "0.3.2",
"bson-objectid": "^2.0.2",
"camelcase": "^6.3.0",
"hyphenate-style-name": "^1.0.4",
@@ -75,6 +75,7 @@
"devDependencies": {
"@remix-run/dev": "^1.2.3",
"@remix-run/vercel": "^1.5.1",
"@storybook/react": "^6.5.8",
"@types/css-tree": "^1.0.7",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/hyphenate-style-name": "^1.0.0",
+5941 -92
View File
File diff suppressed because it is too large. Load diff