feat: Migration von selectedPoiSlice von Recoil zu Redux-Toolkit Slice

- Recoil Atom 'selectedPoiState' entfernt und durch Redux-Toolkit Slice ersetzt.
- Redux Actions hinzugefügt: setSelectedPoi, clearSelectedPoi.
- Selektor 'selectSelectedPoi' erstellt, um POI-Daten zu lesen.
- Komponenten angepasst (PoiUpdateModal, PoiUpdateModalWrapper, MapComponent), um Redux-Hooks zu verwenden.
- Reducer in rootReducer und store.js registriert.
- Funktionalität getestet und Fehlerbehebung implementiert.
This commit is contained in:
ISA
2024-12-23 11:47:28 +01:00
parent 2f39e26225
commit c2f5fa3054
5 changed files with 42 additions and 8 deletions

View File

@@ -69,6 +69,7 @@ import { polylineLayerVisibleState } from "../redux/slices/polylineLayerVisibleS
import { useSelector, useDispatch } from "react-redux";
import { selectCurrentPoi, setCurrentPoi, clearCurrentPoi } from "../redux/slices/currentPoiSlice";
import { selectMapId, selectUserId, setMapId, setUserId } from "../redux/slices/urlParameterSlice";
import { setSelectedPoi } from "../redux/slices/selectedPoiSlice";
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
const dispatch = useDispatch();
@@ -91,7 +92,8 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
const userId = useSelector(selectUserId);
const [AddPoiModalWindowState, setAddPoiModalWindowState] = useState(false);
const [userRights, setUserRights] = useState(null);
const setSelectedPoi = useSetRecoilState(selectedPoiState);
//const setSelectedPoi = useSetRecoilState(selectedPoiState);
dispatch(setSelectedPoi(poiData));
const [showPoiUpdateModal, setShowPoiUpdateModal] = useState(false);
const [currentPoiData, setCurrentPoiData] = useState(null);