Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(collections/geomap): react to archived notes
Elian Doranff422d112ba9
diff --git a/apps/client/src/widgets/collections/geomap/index.css b/apps/client/src/widgets/collections/geomap/index.cssindex 45dbf33f6b..6b8b27d457 100644--- a/apps/client/src/widgets/collections/geomap/index.css+++ b/apps/client/src/widgets/collections/geomap/index.css@@ -68,6 +68,10 @@overflow: hidden;}+.geo-map-container .leaflet-div-icon .archived {+ opacity: 0.5;+}+.geo-map-container.dark .leaflet-div-icon .title-label {color: white;text-shadow: -1px -1px 0 black, 1px -1px 0 black, -1px 1px 0 black, 1px 1px 0 black;diff --git a/apps/client/src/widgets/collections/geomap/index.tsx b/apps/client/src/widgets/collections/geomap/index.tsxindex 7dfc5de58a..d53158b4a5 100644--- a/apps/client/src/widgets/collections/geomap/index.tsx+++ b/apps/client/src/widgets/collections/geomap/index.tsx@@ -154,11 +154,12 @@ function NoteMarker({ note, editable, latLng }: { note: FNote, editable: boolean// React to changesuseNoteLabel(note, "color");useNoteLabel(note, "iconClass");+ const [ archived ] = useNoteLabelBoolean(note, "archived");const title = useNoteProperty(note, "title");const colorClass = note.getColorClass();const iconClass = note.getIcon();- const icon = useMemo(() => buildIcon(iconClass, colorClass ?? undefined, title, note.noteId), [ iconClass, colorClass, title, note.noteId]);+ const icon = useMemo(() => buildIcon(iconClass, colorClass ?? undefined, title, note.noteId, archived), [ iconClass, colorClass, title, note.noteId, archived]);const onClick = useCallback(() => {appContext.triggerCommand("openInPopup", { noteIdOrPath: note.noteId });@@ -223,7 +224,7 @@ function NoteGpxTrack({ note }: { note: FNote }) {return xmlString && <GpxTrack gpxXmlString={xmlString} options={options} />}-function buildIcon(bxIconClass: string, colorClass?: string, title?: string, noteIdLink?: string) {+function buildIcon(bxIconClass: string, colorClass?: string, title?: string, noteIdLink?: string, archived?: boolean) {let html = /*html*/`\<img class="icon" src="${markerIcon}" /><img class="icon-shadow" src="${markerIconShadow}" />@@ -231,7 +232,7 @@ function buildIcon(bxIconClass: string, colorClass?: string, title?: string, not<span class="title-label">${title ?? ""}</span>`;if (noteIdLink) {- html = `<div data-href="#root/${noteIdLink}">${html}</div>`;+ html = `<div data-href="#root/${noteIdLink}" class="${archived ? "archived" : ""}">${html}</div>`;}return divIcon({