Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Allow images for additional files (#3937)

Pedro Ladeira8eba4d4a6d92
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/add-file-modal.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/add-file-modal.tsx
index d62ebce1f9..f519c2862e 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/add-file-modal.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/add-file-modal.tsx
@@ -225,7 +225,7 @@ function FileModalInner({
? truncate(fileName, 25)
: isEditing
? `Current: ${truncate(existingResource?.name || "", 25)} (drop to replace)`
- : "Any document or zip file, max size of 10MB"
+ : "Images, documents, or zip, max size of 10MB"
}
maxFileSizeMB={10}
/>
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx
index dd57b7bb8d..2c064ddddf 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/resources/program-brand-assets/index.tsx
@@ -279,7 +279,7 @@ export function ProgramBrandAssets() {
<SettingsRow
heading="Additional Files"
- description="Any document or zip file, max size 10 MB"
+ description="Images, documents, or zip files, max size 10 MB"
>
<div className="flex flex-col gap-3">
<div className="flex items-center justify-end">
diff --git a/packages/ui/src/file-upload.tsx b/packages/ui/src/file-upload.tsx
index 9ebb9dddc5..a217b11315 100644
--- a/packages/ui/src/file-upload.tsx
+++ b/packages/ui/src/file-upload.tsx
@@ -45,8 +45,16 @@ const acceptFileTypes: Record<
errorMessage: "File type not supported (.svg, .png, .jpg, or .webp only)",
},
programResourceFiles: {
- types: [...documentTypes, "application/zip"],
- errorMessage: "File type not supported (document or zip files only)",
+ types: [
+ "image/svg+xml",
+ "image/png",
+ "image/jpeg",
+ "image/webp",
+ ...documentTypes,
+ "application/zip",
+ ],
+ errorMessage:
+ "File type not supported (.svg, .png, .jpg, .webp, document, or zip files only)",
},
};