Skip to content

Commit 06da586

Browse files
fix(calendar-web): replace image with svgImage and clean up container structure
1 parent 79b0e58 commit 06da586

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

packages/pluggableWidgets/calendar-web/src/Calendar.editorConfig.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
container,
3-
image,
43
rowLayout,
54
structurePreviewPalette,
65
StructurePreviewProps,
6+
svgImage,
77
text
88
} from "@mendix/widget-plugin-platform/preview/structure-preview-api";
99
import { Properties, hidePropertyIn, hidePropertiesIn } from "@mendix/pluggable-widgets-tools";
@@ -46,23 +46,18 @@ export function getPreview(_values: CalendarPreviewProps, isDarkMode: boolean):
4646
const palette = structurePreviewPalette[isDarkMode ? "dark" : "light"];
4747
const readOnly = _values.readOnly;
4848

49-
return container({ grow: 0 })(
49+
return container({
50+
backgroundColor: readOnly ? palette.background.containerDisabled : palette.background.topbarData,
51+
borders: true
52+
})(
5053
rowLayout({
51-
backgroundColor: readOnly ? palette.background.containerDisabled : palette.background.topbarData,
52-
borders: true,
5354
columnSize: "grow",
54-
grow: 0
55+
padding: 6
5556
})(
56-
container({ grow: 0 })(
57-
container({ grow: 0, padding: 1 })(
58-
image(
59-
decodeURIComponent((isDarkMode ? IconSVGDark : IconSVG).replace("data:image/svg+xml,", "")),
60-
16,
61-
16
62-
)
63-
),
64-
text({ fontColor: palette.text.primary, grow: 0 })("Calendar")
65-
)
57+
svgImage({ width: 16, height: 16, grow: 0 })(
58+
decodeURIComponent((isDarkMode ? IconSVGDark : IconSVG).replace("data:image/svg+xml,", ""))
59+
),
60+
text({ fontColor: palette.text.primary })("Calendar")
6661
)
6762
);
6863
}

0 commit comments

Comments
 (0)