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.

add blue to images uploading

Sara Vieira833ce68ddd38
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager.tsx b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager.tsx
index f0b15cdcfc..e7523db089 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/asset-manager.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/asset-manager.tsx
@@ -21,9 +21,7 @@ export const TabContent = ({
if (newImages?.assets.length) {
setAsssets((currentAssets) => [
...newImages.assets,
- ...currentAssets.filter(
- (asset) => "uploading" in asset && !asset.uploading
- ),
+ ...currentAssets.filter((asset) => !("uploading" in asset)),
]);
}
}, [newImages]);
diff --git a/apps/designer/app/designer/features/sidebar-left/panels/components/image.tsx b/apps/designer/app/designer/features/sidebar-left/panels/components/image.tsx
index 475b310def..882965928a 100644
--- a/apps/designer/app/designer/features/sidebar-left/panels/components/image.tsx
+++ b/apps/designer/app/designer/features/sidebar-left/panels/components/image.tsx
@@ -43,16 +43,27 @@ export const AssetManagerImage = ({
title={alt || ""}
css={{
aspectRatio: "1/1",
- backgroundImage: `url(${src})`,
- backgroundSize: "contain",
- backgroundRepeat: "no-repeat",
- backgroundPosition: "center",
display: "flex",
justifyContent: "center",
alignItems: "center",
padding: "0 $2",
+ position: "relative",
}}
>
+ <Box
+ css={{
+ backgroundImage: `url(${src})`,
+ width: "100%",
+ height: "100%",
+ backgroundSize: "contain",
+ backgroundRepeat: "no-repeat",
+ backgroundPosition: "center",
+ position: "absolute",
+ left: 0,
+ top: 0,
+ ...(uploading ? { filter: "blur(1px)", opacity: 0.7 } : {}),
+ }}
+ ></Box>
{uploading && (
<ProgressBar
value={progressBarPercentage}
diff --git a/packages/asset-uploader/src/db/create.ts b/packages/asset-uploader/src/db/create.ts
index 0cb2be322b..6b882fdaac 100644
--- a/packages/asset-uploader/src/db/create.ts
+++ b/packages/asset-uploader/src/db/create.ts
@@ -1,5 +1,6 @@
import { type Location, prisma, Project } from "@webstudio-is/prisma-client";
import sharp from "sharp";
+import { getAssetPath } from "../helpers/get-asset-path";
export const create = async (
projectId: Project["id"],
@@ -24,5 +25,8 @@ export const create = async (
},
});
- return newAsset;
+ return {
+ ...newAsset,
+ path: getAssetPath(newAsset),
+ };
};