From 85a77b36f20ff2e24fefcdd3ab0a38b59b6b82a4 Mon Sep 17 00:00:00 2001 From: "shakespeare.diy" Date: Thu, 23 Jul 2026 23:08:11 +0700 Subject: [PATCH] fix(map): replace speed-dial FAB with two always-visible pill buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove speed-dial/tap-to-expand pattern — buttons are now always visible - "Add Spot" — red (#ff0040), white text, same style as before - "Add Shop" — green (#00cc66), black text, sits above Add Spot - Both cleared of bottom nav via bottom-[calc(5rem+env(safe-area-inset-bottom))] - Removed unused fabOpen state Co-authored-by: shakespeare.diy --- src/pages/MapPage.tsx | 83 +++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 55 deletions(-) diff --git a/src/pages/MapPage.tsx b/src/pages/MapPage.tsx index 2407d09..a4cf2a8 100644 --- a/src/pages/MapPage.tsx +++ b/src/pages/MapPage.tsx @@ -599,8 +599,7 @@ export default function MapPage() { 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 @@ -736,8 +735,6 @@ 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)}`); @@ -1424,63 +1421,39 @@ export default function MapPage() { )} - {/* 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. */} + {/* Add Spot + Add Shop FABs — always visible, bottom-left, clear of bottom nav */}
- {/* Expanded options — slide up when fabOpen */} -
- {user ? ( - <> - setFabOpen(false)}> - - - setFabOpen(false)}> - - - - ) : ( - - )} -
- - {/* Main FAB trigger */} - + {user ? ( + <> + {/* Add Shop — green */} + + + + {/* Add Spot — red */} + + + + + ) : ( + + )}
{/* Near Me button + attribution — floating top-right, hidden when any overlay is open */}