mirror of
https://github.com/soconnor0919/lewisburg-coffee.git
synced 2026-02-05 08:06:32 -05:00
feat: Replace Navbar tooltip with native title attribute and introduce onToggleOpen prop for Drawer close functionality.
This commit is contained in:
@@ -25,9 +25,10 @@ interface DrawerProps {
|
||||
onSelect: (shop: CoffeeShop) => void;
|
||||
onClose: () => void;
|
||||
isOpen: boolean;
|
||||
onToggleOpen?: () => void;
|
||||
}
|
||||
|
||||
export default function Drawer({ shop, shops, onSelect, onClose, isOpen }: DrawerProps) {
|
||||
export default function Drawer({ shop, shops, onSelect, onClose, isOpen, onToggleOpen }: DrawerProps) {
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
const [imageLoading, setImageLoading] = useState(true);
|
||||
|
||||
@@ -149,7 +150,7 @@ export default function Drawer({ shop, shops, onSelect, onClose, isOpen }: Drawe
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={onClose}
|
||||
onClick={onToggleOpen}
|
||||
className="absolute top-4 right-4 bg-background/20 hover:bg-background/40 text-foreground rounded-full h-8 w-8 backdrop-blur-md border border-border/50"
|
||||
>
|
||||
<X className="w-4 h-4" />
|
||||
|
||||
@@ -72,27 +72,19 @@ export default function Navbar({ isDiscoveryOpen, onToggleDiscovery }: NavbarPro
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div
|
||||
className="flex items-center gap-3 px-2 cursor-pointer group absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
||||
onClick={handleHeaderClick}
|
||||
>
|
||||
<div className="p-2 rounded-lg group-hover:bg-primary/10 transition-colors">
|
||||
<Coffee className="h-6 w-6 text-primary" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-lg font-bold font-serif text-foreground leading-none">Lewisburg Coffee Map</h1>
|
||||
<p className="text-xs text-muted-foreground font-serif mt-0.5">Find your perfect brew</p>
|
||||
</div>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom" className="bg-background/80 backdrop-blur-xl border-border/50 text-foreground font-semibold shadow-2xl">
|
||||
<p>About This Map</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
<div
|
||||
className="flex items-center gap-3 px-2 cursor-pointer group absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
||||
onClick={handleHeaderClick}
|
||||
title="About This Map"
|
||||
>
|
||||
<div className="p-2 rounded-lg group-hover:bg-primary/10 transition-colors">
|
||||
<Coffee className="h-6 w-6 text-primary" />
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-lg font-bold font-serif text-foreground leading-none">Lewisburg Coffee Map</h1>
|
||||
<p className="text-xs text-muted-foreground font-serif mt-0.5">Find your perfect brew</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-10" /> {/* Spacer to balance the toggle button */}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user