mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 01:59:04 +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 ]);
|
||||
|
||||
return <div ref={containerRef} className="geo-map-container">
|
||||
<ParentMap.Provider value={mapRef.current}>
|
||||
{children}
|
||||
</ParentMap.Provider>
|
||||
</div>;
|
||||
return (
|
||||
<div
|
||||
ref={containerRef}
|
||||
className={`geo-map-container ${MAP_LAYERS[layerName].isDarkTheme ? "dark" : ""}`}
|
||||
>
|
||||
<ParentMap.Provider value={mapRef.current}>
|
||||
{children}
|
||||
</ParentMap.Provider>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -39,26 +39,12 @@ export default class GeoView extends ViewMode<MapData> {
|
||||
args.$parent.append(this.$root);
|
||||
}
|
||||
|
||||
async renderList() {
|
||||
this.renderMap();
|
||||
return this.$root;
|
||||
}
|
||||
|
||||
async renderMap() {
|
||||
const layerName = this.parentNote.getLabelValue("map:style") ?? ;
|
||||
|
||||
|
||||
if (this.parentNote.hasLabel("map:scale")) {
|
||||
L.control.scale().addTo(map);
|
||||
}
|
||||
|
||||
this.$container.toggleClass("dark", !!layerData.isDarkTheme);
|
||||
|
||||
layer.addTo(map);
|
||||
|
||||
this.map = map;
|
||||
|
||||
this.#onMapInitialized();
|
||||
}
|
||||
|
||||
async #onMapInitialized() {
|
||||
@ -68,7 +54,6 @@ export default class GeoView extends ViewMode<MapData> {
|
||||
}
|
||||
|
||||
const isEditable = !this.isReadOnly;
|
||||
map.on("click", (e) => this.#onMapClicked(e))
|
||||
map.on("contextmenu", (e) => openMapContextMenu(this.parentNote.noteId, e, isEditable));
|
||||
|
||||
if (isEditable) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user