Revize c0b66eaf
Přidáno uživatelem Václav Honzík před asi 2 roky(ů)
frontend/src/features/TrackingTool/Import/ImportContextMenu.tsx | ||
---|---|---|
1 | 1 |
import { LeafletMouseEvent } from 'leaflet' |
2 | 2 |
import { Fragment, useCallback, useState } from 'react' |
3 |
import { Popup, useMap, useMapEvents } from 'react-leaflet' |
|
4 |
|
|
5 |
import * as React from 'react' |
|
6 |
import Divider from '@mui/material/Divider' |
|
7 |
import Paper from '@mui/material/Paper' |
|
8 |
import MenuList from '@mui/material/MenuList' |
|
9 |
import MenuItem from '@mui/material/MenuItem' |
|
10 |
import ListItemText from '@mui/material/ListItemText' |
|
11 |
import ListItemIcon from '@mui/material/ListItemIcon' |
|
3 |
import { Popup, useMapEvents } from 'react-leaflet' |
|
12 | 4 |
import Typography from '@mui/material/Typography' |
13 |
import ContentCut from '@mui/icons-material/ContentCut' |
|
14 |
import ContentCopy from '@mui/icons-material/ContentCopy' |
|
15 |
import ContentPaste from '@mui/icons-material/ContentPaste' |
|
16 |
import Cloud from '@mui/icons-material/Cloud' |
|
17 |
import { Button, Stack, ThemeProvider } from '@mui/material' |
|
5 |
import { Stack } from '@mui/material' |
|
18 | 6 |
import AddFromCoordinatesDialog from './AddFromCoordinatesDialog' |
19 | 7 |
import { useSelector } from 'react-redux' |
20 | 8 |
import { RootState } from '../../redux/store' |
21 |
import { buildTheme } from '../../Theme/ThemeWrapper' |
|
22 | 9 |
import ImportLocationDialog from './ImportLocationDialog' |
10 |
import { PathDto } from '../../../swagger/data-contracts' |
|
23 | 11 |
|
24 | 12 |
const RightClickPopupMenu = () => { |
25 | 13 |
const [open, setOpen] = useState(false) |
26 | 14 |
const [latLng, setLatLng] = useState<[number, number]>([0, 0]) |
27 |
|
|
28 |
const paletteMode = useSelector( |
|
29 |
(state: RootState) => state.theme.paletteMode |
|
30 |
) |
|
15 |
const pathDto = useSelector((state: RootState) => state.trackingTool.pathDto) |
|
31 | 16 |
|
32 | 17 |
useMapEvents({ |
33 | 18 |
contextmenu: (e: LeafletMouseEvent) => { |
19 |
if (!pathDto) { |
|
20 |
return |
|
21 |
} |
|
34 | 22 |
setLatLng([e.latlng.lat, e.latlng.lng]) |
35 | 23 |
setOpen(true) |
36 | 24 |
}, |
Také k dispozici: Unified diff
map icon colors start
re #9741