fix(ui): prevent omitting fileSize from non-images (#11146)
### What? This PR displays file size in upload cards for all upload mimetypes. The current behavior hides this metric from the user if the file mimetype does not start with `image`. ### Why? Showing end-users and editors a file size is universally useful - not only for images, but for all types of files that can be uploaded via the upload field. ### How? By making the predicate that adds this metric less restrictive. Instead of checking if the mimetype is image-like, it checks if the file size is truthy. Before:  After: 
This commit is contained in:
@@ -62,7 +62,7 @@ export function RelationshipContent(props: Props) {
|
||||
|
||||
function generateMetaText(mimeType: string, size: number): string {
|
||||
const sections: string[] = []
|
||||
if (mimeType?.includes('image')) {
|
||||
if (size) {
|
||||
sections.push(formatFilesize(size))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user