mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 18:49:00 +01:00
chore(react/collections/geomap): bring back dark theme labels
This commit is contained in:
parent
50121153dd
commit
dd2b718974
@ -84,9 +84,14 @@ export default function Map({ coordinates, zoom, layerName, viewportChanged, chi
|
|||||||
|
|
||||||
useEffect(() => { mapRef.current && mapRef.current.on("click", onClick) }, [ mapRef, onClick ]);
|
useEffect(() => { mapRef.current && mapRef.current.on("click", onClick) }, [ mapRef, onClick ]);
|
||||||
|
|
||||||
return <div ref={containerRef} className="geo-map-container">
|
return (
|
||||||
|
<div
|
||||||
|
ref={containerRef}
|
||||||
|
className={`geo-map-container ${MAP_LAYERS[layerName].isDarkTheme ? "dark" : ""}`}
|
||||||
|
>
|
||||||
<ParentMap.Provider value={mapRef.current}>
|
<ParentMap.Provider value={mapRef.current}>
|
||||||
{children}
|
{children}
|
||||||
</ParentMap.Provider>
|
</ParentMap.Provider>
|
||||||
</div>;
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,26 +39,12 @@ export default class GeoView extends ViewMode<MapData> {
|
|||||||
args.$parent.append(this.$root);
|
args.$parent.append(this.$root);
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderList() {
|
|
||||||
this.renderMap();
|
|
||||||
return this.$root;
|
|
||||||
}
|
|
||||||
|
|
||||||
async renderMap() {
|
async renderMap() {
|
||||||
const layerName = this.parentNote.getLabelValue("map:style") ?? ;
|
const layerName = this.parentNote.getLabelValue("map:style") ?? ;
|
||||||
|
|
||||||
|
|
||||||
if (this.parentNote.hasLabel("map:scale")) {
|
if (this.parentNote.hasLabel("map:scale")) {
|
||||||
L.control.scale().addTo(map);
|
L.control.scale().addTo(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$container.toggleClass("dark", !!layerData.isDarkTheme);
|
|
||||||
|
|
||||||
layer.addTo(map);
|
|
||||||
|
|
||||||
this.map = map;
|
|
||||||
|
|
||||||
this.#onMapInitialized();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onMapInitialized() {
|
async #onMapInitialized() {
|
||||||
@ -68,7 +54,6 @@ export default class GeoView extends ViewMode<MapData> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isEditable = !this.isReadOnly;
|
const isEditable = !this.isReadOnly;
|
||||||
map.on("click", (e) => this.#onMapClicked(e))
|
|
||||||
map.on("contextmenu", (e) => openMapContextMenu(this.parentNote.noteId, e, isEditable));
|
map.on("contextmenu", (e) => openMapContextMenu(this.parentNote.noteId, e, isEditable));
|
||||||
|
|
||||||
if (isEditable) {
|
if (isEditable) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user