mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 04:55:06 +09:00
fix types
This commit is contained in:
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
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user