«
Předchozí
|
Další
»
Revize 14588cb6
Přidáno uživatelem Václav Honzík před asi 2 roky(ů)
- ID 14588cb653e6b7358e0e641cc2b8d45dc27b5cf8
- Rodič fc8a530f
frontend/src/features/TrackingTool/Controls/MapPointDraggableList.tsx | ||
---|---|---|
1 | 1 |
import { Paper } from '@mui/material' |
2 |
import { useCallback } from 'react' |
|
2 |
import { Fragment, useCallback } from 'react'
|
|
3 | 3 |
import { DropResult } from 'react-beautiful-dnd' |
4 | 4 |
import { useDispatch, useSelector } from 'react-redux' |
5 | 5 |
import { RootState } from '../../redux/store' |
6 |
import { moveMarkerToDestination } from '../trackingToolSlice'
|
|
6 |
import { changeMarkerIdx } from '../trackingToolSlice'
|
|
7 | 7 |
import DragDropCtxWrapper from './DragDropCtxWrapper' |
8 | 8 |
|
9 | 9 |
const MapPointDraggableList = () => { |
... | ... | |
18 | 18 |
} |
19 | 19 |
|
20 | 20 |
dispatch( |
21 |
moveMarkerToDestination({
|
|
21 |
changeMarkerIdx({
|
|
22 | 22 |
source: source.index, |
23 | 23 |
destination: destination.index, |
24 | 24 |
}) |
... | ... | |
28 | 28 |
) |
29 | 29 |
|
30 | 30 |
return ( |
31 |
<Paper variant="outlined"> |
|
32 |
<DragDropCtxWrapper items={path ?? []} onDragEnd={onDragEnd} /> |
|
33 |
</Paper> |
|
31 |
<Fragment> |
|
32 |
{path && ( |
|
33 |
<Paper variant="outlined"> |
|
34 |
<DragDropCtxWrapper |
|
35 |
items={path ?? []} |
|
36 |
onDragEnd={onDragEnd} |
|
37 |
/> |
|
38 |
</Paper> |
|
39 |
)} |
|
40 |
</Fragment> |
|
34 | 41 |
) |
35 | 42 |
} |
36 | 43 |
|
Také k dispozici: Unified diff
fixed keys and indices
re #9741