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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user