diff --git a/src/components/settings/AccountProfileTab.tsx b/src/components/settings/AccountProfileTab.tsx index c4daba14..cc2b221e 100644 --- a/src/components/settings/AccountProfileTab.tsx +++ b/src/components/settings/AccountProfileTab.tsx @@ -154,6 +154,7 @@ export function AccountProfileTab() { ([]); const [uploading, setUploading] = useState(false); @@ -59,10 +61,10 @@ export function PhotoUpload({ const canUploadMore = totalImages < actualMaxFiles; const validateFile = (file: File): string | null => { - // Check file size (10MB limit) - const maxSize = 10 * 1024 * 1024; + // Check file size using configurable limit + const maxSize = maxSizeMB * 1024 * 1024; if (file.size > maxSize) { - return 'File size must be less than 10MB'; + return `File size must be less than ${maxSizeMB}MB`; } // Check file type @@ -307,7 +309,7 @@ export function PhotoUpload({ {uploadedImages.length > 0 || existingPhotos.length > 0 ? 'Change Avatar' : 'Upload Avatar'}

- JPEG, PNG, WebP up to 10MB + JPEG, PNG, WebP up to {maxSizeMB}MB

@@ -372,9 +374,9 @@ export function PhotoUpload({

{isAvatar ? ( - <>Drag & drop or click to browse
JPEG, PNG, WebP up to 10MB + <>Drag & drop or click to browse
JPEG, PNG, WebP up to {maxSizeMB}MB ) : canUploadMore ? ( - <>Drag & drop or click to browse
JPEG, PNG, WebP up to 10MB each + <>Drag & drop or click to browse
JPEG, PNG, WebP up to {maxSizeMB}MB each ) : ( `Maximum ${actualMaxFiles} ${actualMaxFiles === 1 ? 'photo' : 'photos'} allowed` )} diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index 49ba27af..f6561864 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -349,7 +349,7 @@ export default function Profile() {

- { + { toast({ title: "Upload Error", description: error,