Skip to content

Build your personal knowledge base with Trilium Notes

feat(notes): add default icon for GIF

Elian Doran430ef62a2dcc
diff --git a/packages/commons/src/lib/notes.ts b/packages/commons/src/lib/notes.ts
index 6be531b5eb..e9fe892d1e 100644
--- a/packages/commons/src/lib/notes.ts
+++ b/packages/commons/src/lib/notes.ts
@@ -28,6 +28,10 @@ const FILE_MIME_MAPPINGS = {
"application/pdf": "bx bxs-file-pdf",
};
+const IMAGE_MIME_MAPPINGS = {
+ "image/gif": "bx bxs-file-gif",
+};
+
export function getNoteIcon({ noteId, type, mime, iconClass, workspaceIconClass, isFolder }: {
noteId: string;
type: NoteType;
@@ -55,6 +59,9 @@ export function getNoteIcon({ noteId, type, mime, iconClass, workspaceIconClass,
return correspondingMimeType?.icon ?? NOTE_TYPE_ICONS.code;
} else if (type === "file") {
return FILE_MIME_MAPPINGS[mime] ?? NOTE_TYPE_ICONS.file;
+ } else if (type === "image") {
+ return IMAGE_MIME_MAPPINGS[mime] ?? NOTE_TYPE_ICONS.image;
}
+
return NOTE_TYPE_ICONS[type];
}