Refactor: Reorganize state management into atoms and selectors directories
Moved all Recoil atoms to a new 'atoms' directory and selectors to a 'selectors' directory to clarify the project structure and improve maintainability. This change separates concerns by clearly distinguishing between simple state (atoms) and derived state (selectors), facilitating better understanding and scalability of the application's state management.
This commit is contained in:
@@ -11,12 +11,12 @@ import "leaflet.smooth_marker_bouncing";
|
||||
import OverlappingMarkerSpiderfier from "overlapping-marker-spiderfier-leaflet";
|
||||
import DataSheet from "./DataSheet.js";
|
||||
import { useRecoilState, useRecoilValue, RecoilRoot } from "recoil";
|
||||
import { gisStationsStaticDistrictState } from "../store/gisStationState.js";
|
||||
import { gisSystemStaticState } from "../store/gisSystemState.js";
|
||||
import { mapLayersState } from "../store/mapLayersState.js";
|
||||
import { selectedAreaState } from "../store/selectedAreaState.js";
|
||||
import { zoomTriggerState } from "../store/zoomTriggerState.js";
|
||||
import { poiTypState } from "../store/poiTypState.js";
|
||||
import { gisStationsStaticDistrictState } from "../store/atoms/gisStationState.js";
|
||||
import { gisSystemStaticState } from "../store/atoms/gisSystemState.js";
|
||||
import { mapLayersState } from "../store/atoms/mapLayersState.js";
|
||||
import { selectedAreaState } from "../store/atoms/selectedAreaState.js";
|
||||
import { zoomTriggerState } from "../store/atoms/zoomTriggerState.js";
|
||||
import { poiTypState } from "../store/atoms/poiTypState.js";
|
||||
import ShowAddStationPopup from "./ShowAddStationPopup";
|
||||
//import { createRoot } from "react-dom/client";
|
||||
|
||||
@@ -415,7 +415,11 @@ const MapComponent = ({ locations, onLocationUpdate }) => {
|
||||
// Create a root container for the React component inside the popup
|
||||
const root = ReactDOM.createRoot(container);
|
||||
|
||||
root.render(<ShowAddStationPopup map={initMap} latlng={e.latlng} />);
|
||||
root.render(
|
||||
<RecoilRoot>
|
||||
<ShowAddStationPopup map={initMap} latlng={e.latlng} />
|
||||
</RecoilRoot>
|
||||
);
|
||||
|
||||
// Create and configure the popup
|
||||
L.popup().setLatLng(e.latlng).setContent(container).openOn(initMap);
|
||||
|
||||
Reference in New Issue
Block a user