diff --git a/src/components/Map/MapView.jsx b/src/components/Map/MapView.jsx index e0bf43c..6d30431 100644 --- a/src/components/Map/MapView.jsx +++ b/src/components/Map/MapView.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import "maplibre-gl/dist/maplibre-gl.css"; +import "../../styles/map.css"; import "../../styles/mapMarkers.css"; import "../../styles/overlays.css"; @@ -7,7 +8,11 @@ import "../../styles/posts.css"; import "../../styles/filters.css"; import { createPost } from "../../api/client"; -import { FILTER_MAIN_CATEGORIES, FILTER_CATEGORY_MAP, CREATE_CATEGORY_MAP } from "./mapConfig"; +import { + FILTER_MAIN_CATEGORIES, + FILTER_CATEGORY_MAP, + CREATE_CATEGORY_MAP, +} from "./mapConfig"; import { useMapCore } from "./useMapCore"; import { useUserPosition } from "./useUserPosition"; import { usePostsEngine } from "./usePostsEngine"; @@ -52,23 +57,26 @@ export default function MapView({ const [searchQuery, setSearchQuery] = useState(""); - const { status, visiblePosts, loadingPosts, loadError, handleIncomingPost } = usePostsEngine({ - theme, - mapRef, - viewParams, - mainFilter, - subFilter, - timeFilter, - searchQuery, - markersRef, - expandedElRef, - }); + const { status, visiblePosts, loadingPosts, loadError, handleIncomingPost } = + usePostsEngine({ + theme, + mapRef, + viewParams, + mainFilter, + subFilter, + timeFilter, + searchQuery, + markersRef, + expandedElRef, + }); const [isCreating, setIsCreating] = useState(false); const [draftTitle, setDraftTitle] = useState(""); const [draftBody, setDraftBody] = useState(""); const [draftCategory, setDraftCategory] = useState("News"); - const [draftSubCategory, setDraftSubCategory] = useState(CREATE_CATEGORY_MAP.News[0]); + const [draftSubCategory, setDraftSubCategory] = useState( + CREATE_CATEGORY_MAP.News[0] + ); const [draftCoords, setDraftCoords] = useState(null); const [isSaving, setIsSaving] = useState(false); const [saveError, setSaveError] = useState(""); @@ -241,7 +249,9 @@ export default function MapView({ } if (needsEmailVerification) { - setSaveError("Verify your email to post. Use 'Resend email' in the top bar, then login again."); + setSaveError( + "Verify your email to post. Use 'Resend email' in the top bar, then login again." + ); return; } @@ -278,7 +288,8 @@ export default function MapView({ { title: draftTitle.trim(), snippet: draftBody.trim() || draftTitle.trim(), - category: draftCategory === "Events" ? "EVENT" : draftCategory.toUpperCase(), + category: + draftCategory === "Events" ? "EVENT" : draftCategory.toUpperCase(), sub_category: draftSubCategory || "ALL", lat, lon: lng, @@ -299,10 +310,14 @@ export default function MapView({ const msg = String((e && e.message) || "").toLowerCase(); const isNotVerified = code === "email_not_verified" || - (e && e.status === 403 && (msg.includes("not verified") || msg.includes("verify"))); + (e && + e.status === 403 && + (msg.includes("not verified") || msg.includes("verify"))); if (isNotVerified) { - setSaveError("Verify your email to post. Use 'Resend email' in the top bar, then login again."); + setSaveError( + "Verify your email to post. Use 'Resend email' in the top bar, then login again." + ); } else { setSaveError((e && e.message) || "Error creating post."); } @@ -331,66 +346,71 @@ export default function MapView({
{status &&