fix(web): update search, listing, and map components

Improve agent profile client, comparison table, image gallery/upload,
listing map, filter bar, property card, and search results components
with better error handling, type safety, and UX refinements.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-11 01:40:15 +07:00
parent 759052a71f
commit 1b86c5bf2c
8 changed files with 74 additions and 16 deletions

View File

@@ -198,7 +198,7 @@ export function ListingMap({ listings, onMarkerClick, selectedListingId, classNa
function showPopup(map: mapboxgl.Map, marker: MapMarker) {
popupRef.current?.remove();
const popup = new mapboxgl.Popup({ offset: 25, maxWidth: '260px', closeButton: true })
const popup = new mapboxgl.Popup({ offset: 25, maxWidth: 'min(260px, 85vw)', closeButton: true })
.setLngLat([marker.lng, marker.lat])
.setDOMContent(buildPopupContent(marker.listing))
.addTo(map);
@@ -209,7 +209,7 @@ export function ListingMap({ listings, onMarkerClick, selectedListingId, classNa
const hasToken = typeof process !== 'undefined' && process.env['NEXT_PUBLIC_MAPBOX_TOKEN'];
return (
<div className={`relative overflow-hidden rounded-lg border ${className || 'h-[500px]'}`}>
<div className={`relative overflow-hidden rounded-lg border ${className || 'h-[300px] md:h-[500px]'}`}>
<div ref={mapContainerRef} className="h-full w-full" />
{/* Fallback when no Mapbox token */}