From bdee1557601c54555dcfffff0878543d840cf826 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Fri, 5 Dec 2025 10:25:10 -0500 Subject: [PATCH] feat: add tooltips to map markers displaying shop names --- src/app/page.tsx | 30 +++++++++++++++++------------- src/components/Drawer.tsx | 2 +- src/components/LocateControl.tsx | 2 +- src/components/Map.tsx | 10 ++++++++-- src/components/MapStyleControl.tsx | 2 +- src/components/Navbar.tsx | 2 +- src/components/ZoomControls.tsx | 6 +++--- 7 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 721f4ca..4996e97 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -22,8 +22,23 @@ export default function HomePage() { return (
- {/* Navbar - always visible */} - setIsDiscoveryOpen(!isDiscoveryOpen)} /> + {/* Unified shadow container for navbar + drawer */} +
+ {/* Navbar - always visible */} + setIsDiscoveryOpen(!isDiscoveryOpen)} /> + + {/* Right Drawer - only render after mount to prevent hydration mismatch */} + {mounted && ( + setSelectedShop(null)} + isOpen={isDiscoveryOpen} + onToggleOpen={() => setIsDiscoveryOpen(false)} + /> + )} +
{/* Map Background */}
@@ -36,17 +51,6 @@ export default function HomePage() { />
- {/* Right Drawer - only render after mount to prevent hydration mismatch */} - {mounted && ( - setSelectedShop(null)} - isOpen={isDiscoveryOpen} - onToggleOpen={() => setIsDiscoveryOpen(false)} - /> - )}
); diff --git a/src/components/Drawer.tsx b/src/components/Drawer.tsx index f1b36ba..d1c380d 100644 --- a/src/components/Drawer.tsx +++ b/src/components/Drawer.tsx @@ -48,7 +48,7 @@ export default function Drawer({ shop, shops, onSelect, onClose, isOpen, onToggl
- + {shop ? ( // Details View // Details View diff --git a/src/components/LocateControl.tsx b/src/components/LocateControl.tsx index 9c0be1b..51fbfd9 100644 --- a/src/components/LocateControl.tsx +++ b/src/components/LocateControl.tsx @@ -72,7 +72,7 @@ export function LocateControl() { size="icon" onClick={handleLocate} disabled={loading} - className="bg-background/60 dark:bg-background/60 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground" + className="bg-background/60 dark:bg-background/65 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground" > Locate me diff --git a/src/components/Map.tsx b/src/components/Map.tsx index 86af300..cf73a14 100644 --- a/src/components/Map.tsx +++ b/src/components/Map.tsx @@ -1,6 +1,6 @@ "use client"; -import { MapContainer, TileLayer, Marker, useMap } from 'react-leaflet'; +import { MapContainer, TileLayer, Marker, Tooltip, useMap } from 'react-leaflet'; import 'leaflet/dist/leaflet.css'; import L from 'leaflet'; import { useState, useEffect } from 'react'; @@ -140,7 +140,13 @@ const Map = ({ shops, onShopSelect, selectedShop }: MapProps) => { eventHandlers={{ click: () => onShopSelect(shop), }} - /> + > + +
+ {shop.name} +
+
+ ))} ); diff --git a/src/components/MapStyleControl.tsx b/src/components/MapStyleControl.tsx index 7dcad32..11e7820 100644 --- a/src/components/MapStyleControl.tsx +++ b/src/components/MapStyleControl.tsx @@ -19,7 +19,7 @@ export function MapStyleControl({ currentStyle, onStyleChange }: MapStyleControl return ( - diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index b3797e9..0c20025 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -41,7 +41,7 @@ export default function Navbar({ isDiscoveryOpen, onToggleDiscovery }: NavbarPro return ( <>
-
+
{/* Pulsing indicator ring - only during onboarding */} {isOnboarding && showTooltip && ( diff --git a/src/components/ZoomControls.tsx b/src/components/ZoomControls.tsx index 2e7930c..953816e 100644 --- a/src/components/ZoomControls.tsx +++ b/src/components/ZoomControls.tsx @@ -13,7 +13,7 @@ export function ZoomControls() { variant="outline" size="icon" onClick={() => map.zoomIn()} - className="bg-background/60 dark:bg-background/60 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground" + className="bg-background/60 dark:bg-background/65 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground hover:bg-background/70 dark:hover:bg-background/75" > Zoom in @@ -22,7 +22,7 @@ export function ZoomControls() { variant="outline" size="icon" onClick={() => map.zoomOut()} - className="bg-background/60 dark:bg-background/60 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground" + className="bg-background/60 dark:bg-background/65 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground hover:bg-background/70 dark:hover:bg-background/75" > Zoom out @@ -31,7 +31,7 @@ export function ZoomControls() { variant="outline" size="icon" onClick={() => map.setView([40.9645, -76.8845], 15)} - className="bg-background/60 dark:bg-background/60 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground" + className="bg-background/60 dark:bg-background/65 backdrop-blur-2xl border-border/50 dark:border-border/50 h-10 w-10 rounded-lg shadow-2xl text-foreground hover:bg-background/70 dark:hover:bg-background/75" > Reset view