private shares and revokation works
This commit is contained in:
@@ -10,6 +10,7 @@ import { useDrawingStore } from '../../stores/drawingStore';
|
||||
interface MapItemsLayerProps {
|
||||
mapId: string;
|
||||
refreshTrigger: number;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
// Custom marker icons for devices using CSS
|
||||
@@ -58,7 +59,7 @@ const outdoorApIcon = new L.DivIcon({
|
||||
iconAnchor: [20, 40],
|
||||
});
|
||||
|
||||
export function MapItemsLayer({ mapId, refreshTrigger }: MapItemsLayerProps) {
|
||||
export function MapItemsLayer({ mapId, refreshTrigger, readOnly = false }: MapItemsLayerProps) {
|
||||
const [items, setItems] = useState<MapItem[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [contextMenu, setContextMenu] = useState<{
|
||||
@@ -145,10 +146,12 @@ export function MapItemsLayer({ mapId, refreshTrigger }: MapItemsLayerProps) {
|
||||
eventHandlers={{
|
||||
contextmenu: (e) => {
|
||||
L.DomEvent.stopPropagation(e);
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
if (!readOnly) {
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
}
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -230,10 +233,12 @@ export function MapItemsLayer({ mapId, refreshTrigger }: MapItemsLayerProps) {
|
||||
eventHandlers={{
|
||||
contextmenu: (e) => {
|
||||
L.DomEvent.stopPropagation(e);
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
if (!readOnly) {
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
}
|
||||
},
|
||||
}}
|
||||
>
|
||||
@@ -290,10 +295,12 @@ export function MapItemsLayer({ mapId, refreshTrigger }: MapItemsLayerProps) {
|
||||
eventHandlers={{
|
||||
contextmenu: (e) => {
|
||||
L.DomEvent.stopPropagation(e);
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
if (!readOnly) {
|
||||
setContextMenu({
|
||||
item,
|
||||
position: { x: e.originalEvent.clientX, y: e.originalEvent.clientY }
|
||||
});
|
||||
}
|
||||
},
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user