diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index 6351cf7..2407d09 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -68,6 +68,8 @@ import { MapPin, LocateFixed, LocateOff, + Store, + Info, } from 'lucide-react'; import { CameraCapture } from '@/components/CameraCapture'; import { useUploadFile } from '@/hooks/useUploadFile'; @@ -595,6 +597,10 @@ export default function MapPage() { const [flyTo, setFlyTo] = useState<{ lat: number; lng: number; zoom?: number } | null>(null); const [nearMeLoading, setNearMeLoading] = useState(false); const [nearMeError, setNearMeError] = useState<'denied' | 'unavailable' | 'timeout' | null>(null); + const [showLocationHelp, setShowLocationHelp] = useState(false); + + // Speed-dial FAB open state + const [fabOpen, setFabOpen] = useState(false); const handleNearMe = () => { // Clear previous error @@ -623,11 +629,7 @@ export default function MapPage() { setNearMeLoading(false); if (err.code === err.PERMISSION_DENIED) { setNearMeError('denied'); - toast({ - title: 'Location access denied', - description: 'To find spots near you, allow location access in your browser settings, then try again.', - variant: 'destructive', - }); + setShowLocationHelp(true); } else if (err.code === err.TIMEOUT) { setNearMeError('timeout'); toast({ @@ -734,6 +736,8 @@ export default function MapPage() { ); const handleMapClick = (lat: number, lng: number) => { + // Close speed-dial FAB if open + setFabOpen(false); if (!user) return; // Navigate to create spot with coordinates pre-filled navigate(`/create-spot?lat=${lat.toFixed(6)}&lng=${lng.toFixed(6)}`); @@ -1420,31 +1424,63 @@ export default function MapPage() { )} - {/* Add Spot FAB — primary CTA, bottom-left. - Hidden when Sasquatch panel is open (user is in chat mode). - Hidden when mobile filters or spot sheet is open. */} + {/* Speed-dial FAB — bottom-right, above filter pills, clear of bottom nav. + Tap the + button to expand into Add Spot + Add Shop options. + Hidden when overlays open. Desktop gets a different layout so md:hidden. */}
- {user ? ( - - + + setFabOpen(false)}> + + + + ) : ( + - - ) : ( - - )} + )} +
+ + {/* Main FAB trigger */} + {/* Near Me button + attribution — floating top-right, hidden when any overlay is open */} @@ -1453,7 +1489,7 @@ export default function MapPage() { mobileFiltersOpen ? "opacity-0 pointer-events-none" : "opacity-100" )}> + + + )} + {/* Right-side control column — filter pills + Quick Snap (mobile only, hidden when overlays open) */}
{/* Layer filter pills — compact icon-only */}