diff --git a/src/components/homepage/FeaturedParks.tsx b/src/components/homepage/FeaturedParks.tsx index 1da67649..9fa2a21a 100644 --- a/src/components/homepage/FeaturedParks.tsx +++ b/src/components/homepage/FeaturedParks.tsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import { Star, TrendingUp, Award, Castle, FerrisWheel, Waves, Tent, LucideIcon } from 'lucide-react'; +import { formatLocationShort } from '@/lib/locationFormatter'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; @@ -82,7 +83,7 @@ export function FeaturedParks() { {park.location && (

- {park.location.city}, {park.location.country} + {formatLocationShort(park.location)}

)} diff --git a/src/components/moderation/displays/RichParkDisplay.tsx b/src/components/moderation/displays/RichParkDisplay.tsx index 0adf7155..ed81a473 100644 --- a/src/components/moderation/displays/RichParkDisplay.tsx +++ b/src/components/moderation/displays/RichParkDisplay.tsx @@ -109,9 +109,11 @@ export function RichParkDisplay({ data, actionType, showAllFields = true }: Rich Location
+ {location.street_address &&
Street: {location.street_address}
} {location.city &&
City: {location.city}
} {location.state_province &&
State/Province: {location.state_province}
} {location.country &&
Country: {location.country}
} + {location.postal_code &&
Postal Code: {location.postal_code}
} {location.formatted_address && (
{location.formatted_address}
)} diff --git a/src/components/parks/ParkCard.tsx b/src/components/parks/ParkCard.tsx index 1cf213e8..575f737d 100644 --- a/src/components/parks/ParkCard.tsx +++ b/src/components/parks/ParkCard.tsx @@ -1,4 +1,5 @@ import { MapPin, Star, Users, Clock, Castle, FerrisWheel, Waves, Tent } from 'lucide-react'; +import { formatLocationShort } from '@/lib/locationFormatter'; import { useNavigate } from 'react-router-dom'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; @@ -102,7 +103,7 @@ export function ParkCard({ park }: ParkCardProps) {
- {park.location.city && `${park.location.city}, `}{park.location.country} + {formatLocationShort(park.location)}
)} diff --git a/src/components/search/SearchResults.tsx b/src/components/search/SearchResults.tsx index d6b0c2e3..455f1af8 100644 --- a/src/components/search/SearchResults.tsx +++ b/src/components/search/SearchResults.tsx @@ -1,6 +1,7 @@ import { useState, useEffect } from 'react'; import { useDebouncedValue } from '@/hooks/useDebouncedValue'; import { useGlobalSearch } from '@/hooks/search/useGlobalSearch'; +import { formatLocationShort } from '@/lib/locationFormatter'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; @@ -87,7 +88,7 @@ export function SearchResults({ query, onClose }: SearchResultsProps) { switch (result.type) { case 'park': const park = result.data as Park; - return park.location ? `${park.location.city}, ${park.location.country}` : 'Theme Park'; + return park.location ? formatLocationShort(park.location) : 'Theme Park'; case 'ride': const ride = result.data as Ride; return ride.park && typeof ride.park === 'object' && 'name' in ride.park diff --git a/src/pages/ParkDetail.tsx b/src/pages/ParkDetail.tsx index a2e048c6..42e1ca6c 100644 --- a/src/pages/ParkDetail.tsx +++ b/src/pages/ParkDetail.tsx @@ -9,6 +9,7 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Separator } from '@/components/ui/separator'; import { MapPin, Star, Clock, Phone, Globe, Calendar, ArrowLeft, Users, Zap, Camera, Castle, FerrisWheel, Waves, Tent, Plus } from 'lucide-react'; +import { formatLocationShort } from '@/lib/locationFormatter'; import { useAuth } from '@/hooks/useAuth'; import { ReviewsSection } from '@/components/reviews/ReviewsSection'; import { RideCard } from '@/components/rides/RideCard'; @@ -248,7 +249,7 @@ export default function ParkDetail() { {park.location &&
- {park.location.city && `${park.location.city}, `}{park.location.country} + {formatLocationShort(park.location)}
}
Address:
- {park.location.name &&
{park.location.name}
} - {park.location.city &&
{park.location.city}
} - {park.location.state_province &&
{park.location.state_province}
} - {park.location.postal_code &&
{park.location.postal_code}
} -
{park.location.country}
+ {/* Street Address on its own line if it exists */} + {park.location.street_address && ( +
{park.location.street_address}
+ )} + + {/* City, State Postal on same line */} + {(park.location.city || park.location.state_province || park.location.postal_code) && ( +
+ {park.location.city} + {park.location.city && park.location.state_province && ', '} + {park.location.state_province} + {park.location.postal_code && ` ${park.location.postal_code}`} +
+ )} + + {/* Country on its own line */} + {park.location.country && ( +
{park.location.country}
+ )}