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.

correct passing of category to Control components

Sultan5f7a6d78bbe7
diff --git a/apps/designer/app/designer/features/style-panel/shared/configs.ts b/apps/designer/app/designer/features/style-panel/shared/configs.ts
index 27f13e8e66..6f04b8889c 100644
--- a/apps/designer/app/designer/features/style-panel/shared/configs.ts
+++ b/apps/designer/app/designer/features/style-panel/shared/configs.ts
@@ -84,7 +84,6 @@ const createStyleConfigs = () => {
label,
property,
appliesTo: properties[property].appliesTo,
- category: category,
control: getControl(property),
items: keywords.map((keyword: string) => ({
label: keyword,
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsx
index e5241d72f8..02b3a9e4b0 100644
--- a/apps/designer/app/designer/features/style-panel/style-section.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx
@@ -106,6 +106,7 @@ type ControlProps = {
currentStyle: Style;
inheritedStyle: InheritedStyle;
styleConfig: StyleConfig;
+ category: Category;
};
const ColorControl = ({
@@ -184,6 +185,7 @@ const ComboboxControl = ({
inheritedStyle,
setProperty,
styleConfig,
+ category,
}: ControlProps) => {
const isCurrentBreakpoint = useIsFromCurrentBreakpoint(styleConfig.property);
@@ -203,8 +205,8 @@ const ComboboxControl = ({
switch (styleConfig.property) {
case "rowGap":
case "columnGap": {
- switch (styleConfig.category) {
- case "layout":
+ switch (category) {
+ case "layout": {
const Icon = (
icons as unknown as {
gap: Record<string, (props: unknown) => JSX.Element>;
@@ -259,6 +261,7 @@ const ComboboxControl = ({
/>
</Grid>
);
+ }
}
}
}
@@ -593,6 +596,7 @@ export const renderProperty = ({
inheritedStyle={inheritedStyle}
setProperty={setProperty}
styleConfig={styleConfig}
+ category={category}
/>
</Box>
);