Skip to content

Commit

Permalink
feat: Display shared drives with server icon
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Feb 24, 2025
1 parent 00bfa5b commit b12a2d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/filelist/icons/FileThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
isNextcloudShortcut,
isNextcloudFile
} from '@/modules/nextcloud/helpers'
import { isSharedDriveFolder } from '@/modules/shareddrives/helpers'

interface FileThumbnailProps {
file: File | FolderPickerEntry
Expand Down Expand Up @@ -70,7 +71,8 @@ const FileThumbnail: React.FC<FileThumbnailProps> = ({

if (
file._id === 'io.cozy.files.shared-drives-dir' ||
isNextcloudShortcut(file)
isNextcloudShortcut(file) ||
isSharedDriveFolder(file)
) {
return <Icon icon={IconServer} size={size ?? 32} />
}
Expand Down
11 changes: 11 additions & 0 deletions src/modules/shareddrives/helpers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { File, FolderPickerEntry } from '@/components/FolderPicker/types'

export const isSharedDriveFolder = (
file: File | FolderPickerEntry
): boolean => {
return (
file._type === 'io.cozy.files' &&
file.dir_id === 'io.cozy.files.shared-drives-dir' &&
file.type === 'directory'
)
}

0 comments on commit b12a2d5

Please sign in to comment.