From c6263f00504d69ed75ba2e21fd5edd1ddc83c310 Mon Sep 17 00:00:00 2001 From: cilasmarques Date: Mon, 7 Oct 2024 17:28:58 -0300 Subject: [PATCH] fix: update mapsdata loading --- src/components/MapTiff/MapTiff.tsx | 8 ++++---- src/components/MapTiff/Section/MapSection.tsx | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/MapTiff/MapTiff.tsx b/src/components/MapTiff/MapTiff.tsx index bc95a8c..63ca881 100644 --- a/src/components/MapTiff/MapTiff.tsx +++ b/src/components/MapTiff/MapTiff.tsx @@ -3,33 +3,33 @@ import maplibregl from "maplibre-gl"; import "maplibre-gl/dist/maplibre-gl.css"; import { createRoot } from "react-dom/client"; -import { useCallback, useContext, useEffect, useRef, useState } from "react"; +import { useCallback, useEffect, useRef, useState } from "react"; import { MapContainer, Loading, LoadingText } from "./MapTiff.styles"; -import { IMapInfo } from "@/utils/interfaces"; +import { IEEInfo, IMapInfo } from "@/utils/interfaces"; import { MAP_TIFF_STYLE, MAP_TIFF_BRAZIL_STATES, MAP_TIFF_BRAZIL_CITIES, } from "@/utils/constants"; -import { CMSContext } from "@/contexts/ContentProvider"; import MapPopup from "../MapPopup/MapPopup"; const HOST_URL = process.env.NEXT_PUBLIC_HOST_URL; const MapTiff = ({ + mapsData, data, loading, setLoading, onClick, ...props }: { + mapsData: { fields: IEEInfo }[]; data: IMapInfo; loading: boolean; setLoading: (e: boolean) => void; onClick?: (e: any) => void; }) => { const { name, year } = data; - const { mapsData } = useContext(CMSContext); const [map, setMap] = useState(null); const mapContainer = useRef(null); const popupRef = useRef( diff --git a/src/components/MapTiff/Section/MapSection.tsx b/src/components/MapTiff/Section/MapSection.tsx index 6d611bb..45a615f 100644 --- a/src/components/MapTiff/Section/MapSection.tsx +++ b/src/components/MapTiff/Section/MapSection.tsx @@ -101,6 +101,7 @@ const MapSection = ({ mapsData }: { mapsData: { fields: IEEInfo }[] }) => {