From a81e4f51ab1aead6b2431c869acc90574cab364c Mon Sep 17 00:00:00 2001 From: renee-png Date: Sun, 7 Jun 2026 22:41:27 -0400 Subject: [PATCH] RV/Boat Lots: map tab edits the association Map amenity + per-pin amount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Map tab now binds to the association's active map-type amenity (the reservation map) instead of a separate table — pins edited here are the public reservation map. Adds a per-pin amount ($/mo) field (GoogleMapPicker showAmount prop, backward-compatible). Shows a notice when no Map amenity is active and an amenity picker when more than one exists. Co-Authored-By: Claude Opus 4.8 --- .../association/GoogleMapPicker.tsx | 20 ++++- src/pages/RVBoatLotsPage.tsx | 83 +++++++++++++------ 2 files changed, 76 insertions(+), 27 deletions(-) diff --git a/src/components/association/GoogleMapPicker.tsx b/src/components/association/GoogleMapPicker.tsx index b203331..a07c993 100644 --- a/src/components/association/GoogleMapPicker.tsx +++ b/src/components/association/GoogleMapPicker.tsx @@ -14,6 +14,7 @@ export interface MapPinData { lng: string; status: "available" | "unavailable"; linked_amenity_id?: string; + amount?: number; } interface Props { @@ -28,9 +29,11 @@ interface Props { linkLabel?: string; /** When true, the link dropdown shows regardless of pin status. */ allowLinkAnyStatus?: boolean; + /** When true, each pin gets a per-pin amount ($) field. */ + showAmount?: boolean; } -export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange, linkLabel = "form", allowLinkAnyStatus = false }: Props) { +export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChange, formAmenities, lockedView, onLockedViewChange, linkLabel = "form", allowLinkAnyStatus = false, showAmount = false }: Props) { const mapRef = useRef(null); const mapInstance = useRef(null); const markersRef = useRef([]); @@ -237,6 +240,21 @@ export default function GoogleMapPicker({ pins, onChange, zoom = 16, onZoomChang
{pin.lat}, {pin.lng}
+ {showAmount && ( +
+ $ + updatePin(pin.id, { amount: e.target.value === "" ? undefined : Number(e.target.value) })} + className="text-sm h-8 w-[130px]" + /> + / mo +
+ )}
{ setSelectedMapAmenityId(v); applyAmenityToMap(mapAmenities.find(a => a.id === v)); }}> + + {mapAmenities.map(a => {a.name})} + + )} + +
- ({ id: u.id, name: `Unit ${u.unit_number}` }))} - /> + {mapAmenities.length === 0 ? ( +

+ No active Map amenity for this association. Create or activate a Map amenity in the association's Amenities, then manage its lot pins here. +

+ ) : ( + ({ id: u.id, name: `Unit ${u.unit_number}` }))} + /> + )}