Skip to content

Commit 0e4d76d

Browse files
authored
fix: Bring back upload button in several cases (#5549)
## Description Regression, button for upload was removed in case of favicon, page settings, marketplace settings ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 2f14013 commit 0e4d76d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

apps/builder/app/builder/shared/assets/asset-upload.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ const EnabledAssetUpload = ({ accept, type }: AssetUploadProps) => {
121121
);
122122
};
123123

124-
export const AssetUpload = ({ type }: AssetUploadProps) => {
124+
export const AssetUpload = ({ type, accept }: AssetUploadProps) => {
125125
const authPermit = useStore($authPermit);
126126

127127
if (authPermit !== "view") {
128128
// Split into a separate component to avoid using `useUpload` hook unnecessarily
129129
// (It's hard to mock this hook in storybook)
130-
return <EnabledAssetUpload type={type} />;
130+
return <EnabledAssetUpload type={type} accept={accept} />;
131131
}
132132

133133
return (

apps/builder/app/shared/project-settings/image-control.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ReactElement } from "react";
22
import { FloatingPanel } from "@webstudio-is/design-system";
33
import { AssetManager } from "~/builder/shared/asset-manager";
4+
import { AssetUpload } from "~/builder/shared/assets";
45

56
// @todo should be moved to shared as its being reused in another feature
67
export const ImageControl = (props: {
@@ -10,6 +11,7 @@ export const ImageControl = (props: {
1011
return (
1112
<FloatingPanel
1213
title="Images"
14+
titleSuffix={<AssetUpload type="image" accept="image/*" />}
1315
placement="bottom-within"
1416
content={
1517
<AssetManager

0 commit comments

Comments
 (0)