Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Fix types

Andrey Okonetchnikov5e40b613b889
diff --git a/app/designer/features/props-panel/props-panel.stories.tsx b/app/designer/features/props-panel/props-panel.stories.tsx
index a9ba1a6863..39ff9e08cc 100644
--- a/app/designer/features/props-panel/props-panel.stories.tsx
+++ b/app/designer/features/props-panel/props-panel.stories.tsx
@@ -11,12 +11,20 @@ export const NoProps: ComponentStoryObj<typeof PropsPanel> = {
args: {
selectedInstanceData: {
id: "1",
- component: "Heading",
+ component: "Button",
cssRules: [],
browserStyle: {},
props: {
id: "1",
- props: [],
+ props: [
+ {
+ id: "disabled",
+ prop: "disabled",
+ value: true,
+ },
+ ],
+ instanceId: "2",
+ treeId: "1",
},
},
},
@@ -25,24 +33,26 @@ export const NoProps: ComponentStoryObj<typeof PropsPanel> = {
export const DefaultProps: ComponentStoryObj<typeof PropsPanel> = {
args: {
selectedInstanceData: {
- id: "2",
+ id: "1",
component: "Button",
cssRules: [],
browserStyle: {},
props: {
id: "1",
- props: [
- {
- id: "disabled",
- prop: "disabled",
- value: true,
- },
- ],
+ props: [],
+ instanceId: "2",
+ treeId: "1",
},
},
},
};
+const meta = componentsMeta["Button"];
+const argTypes = meta?.argTypes as Record<
+ string,
+ { control: { defaultValue?: unknown } }
+>; // TODO: Add type to argTypes
+
export const AllProps: ComponentStoryObj<typeof PropsPanel> = {
args: {
selectedInstanceData: {
@@ -52,15 +62,15 @@ export const AllProps: ComponentStoryObj<typeof PropsPanel> = {
browserStyle: {},
props: {
id: "2",
- props: Object.entries(componentsMeta["Heading"].argTypes).map(
- ([prop, value]) => {
- return {
- id: `${prop}`,
- prop,
- value: value.control.defaultValue,
- } as UserProp;
- }
- ),
+ instanceId: "2",
+ treeId: "1",
+ props: Object.entries(argTypes).map(([prop, value]) => {
+ return {
+ id: `${prop}`,
+ prop,
+ value: value.control.defaultValue,
+ } as UserProp;
+ }),
},
},
},