Fix UI feedback (tile contrast, PDF thumbnails)
All checks were successful
Automated Container Build / build-and-push (push) Successful in 30s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 30s
This commit is contained in:
parent
c7d39144cd
commit
3c3bf4dd8b
3 changed files with 31 additions and 10 deletions
|
|
@ -1161,7 +1161,7 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
const isVideo = ['mp4', 'mkv', 'avi', 'mov', 'webm', 'ogg'].includes(ext) || file.mime_type?.startsWith('video/');
|
||||
const isOffice = ['docx', 'doc', 'pptx', 'ppt', 'xlsx', 'xls'].includes(ext) || file.mime_type?.includes('officedocument');
|
||||
const isAudio = ['mp3', 'flac', 'wav', 'm4a', 'wma', 'aac'].includes(ext) || file.mime_type?.startsWith('audio/');
|
||||
const isMedia = isImage || isVideo || isOffice || isAudio;
|
||||
const isMedia = isImage || isVideo || isOffice || isAudio || ext === 'pdf';
|
||||
|
||||
if (ext === 'pdf') {
|
||||
return (
|
||||
|
|
@ -1240,10 +1240,25 @@ export default function FileExplorer({ onLogout }: FileExplorerProps) {
|
|||
})();
|
||||
|
||||
if (isMedia && file.checksum && viewMode === 'grid') {
|
||||
const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : null;
|
||||
const docType = file.name.endsWith('.docx') ? 'docs' : file.name.endsWith('.pptx') ? 'slides' : (file.name.endsWith('.xlsx') || file.name.endsWith('.xls')) ? 'sheets' : file.name.endsWith('.pdf') ? 'pdf' : null;
|
||||
// Use fallbackIcon for PDF too so it shows "PDF" text while loading
|
||||
const currentFallback = ext === 'pdf' ? (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-5 h-5 rounded text-[6px] flex-shrink-0 aspect-square'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
||||
PDF
|
||||
</div>
|
||||
) : fallbackIcon;
|
||||
|
||||
return (
|
||||
<div className="relative w-full h-full flex items-center justify-center overflow-hidden rounded-md">
|
||||
<ThumbnailImage checksum={file.checksum} fallbackIcon={fallbackIcon} downloadToken={downloadToken || ''} docType={docType} />
|
||||
<ThumbnailImage checksum={file.checksum} fallbackIcon={currentFallback} downloadToken={downloadToken || ''} docType={docType} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (ext === 'pdf') {
|
||||
return (
|
||||
<div className={`${large ? 'w-20 h-20 rounded-2xl text-2xl' : 'w-5 h-5 rounded text-[6px] flex-shrink-0 aspect-square'} flex items-center justify-center font-black tracking-tighter shadow-sm text-white bg-[#ea4335]`}>
|
||||
PDF
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue