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: No image at page settings (#2536)

Ivan Starkov2fe575ad2c1e
diff --git a/apps/builder/app/builder/features/sidebar-left/panels/pages/social-preview.tsx b/apps/builder/app/builder/features/sidebar-left/panels/pages/social-preview.tsx
index 161e284609..1e924f7317 100644
--- a/apps/builder/app/builder/features/sidebar-left/panels/pages/social-preview.tsx
+++ b/apps/builder/app/builder/features/sidebar-left/panels/pages/social-preview.tsx
@@ -12,13 +12,19 @@ type SocialPreviewProps = {
};
const imgStyle = css({
- objectFit: "cover",
borderTopLeftRadius: theme.borderRadius[4],
borderTopRightRadius: theme.borderRadius[4],
width: "100%",
aspectRatio: "1.91 / 1",
background: "#DFE3E6",
borderBottom: `1px solid ${theme.colors.borderMain}`,
+ variants: {
+ hasImage: {
+ true: {
+ objectFit: "cover",
+ },
+ },
+ },
});
export const SocialPreview = ({
@@ -46,7 +52,9 @@ export const SocialPreview = ({
<Image
src={asset?.type === "image" ? asset.name : undefined}
loader={imageLoader}
- className={imgStyle()}
+ className={imgStyle({
+ hasImage: asset?.type === "image" ? true : undefined,
+ })}
/>
<Grid