Refactor park detail address display

Implement the plan to refactor the address display in the park detail page. This includes updating the sidebar address to show the street address on its own line, followed by city, state, and postal code on the next line, and the country on a separate line. This change aims to create a more compact and natural address format.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-06 14:03:58 +00:00
parent 98fbc94476
commit fc7c2d5adc
5 changed files with 29 additions and 9 deletions

View File

@@ -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() {
</h1>
{park.location && <div className="flex items-center text-white/90 text-lg">
<MapPin className="w-5 h-5 mr-2" />
{park.location.city && `${park.location.city}, `}{park.location.country}
{formatLocationShort(park.location)}
</div>}
<div className="mt-3">
<VersionIndicator
@@ -470,11 +471,25 @@ export default function ParkDetail() {
<div className="text-sm text-muted-foreground">
<div className="font-medium text-foreground mb-1">Address:</div>
<div className="space-y-1">
{park.location.name && <div>{park.location.name}</div>}
{park.location.city && <div>{park.location.city}</div>}
{park.location.state_province && <div>{park.location.state_province}</div>}
{park.location.postal_code && <div>{park.location.postal_code}</div>}
<div>{park.location.country}</div>
{/* Street Address on its own line if it exists */}
{park.location.street_address && (
<div>{park.location.street_address}</div>
)}
{/* City, State Postal on same line */}
{(park.location.city || park.location.state_province || park.location.postal_code) && (
<div>
{park.location.city}
{park.location.city && park.location.state_province && ', '}
{park.location.state_province}
{park.location.postal_code && ` ${park.location.postal_code}`}
</div>
)}
{/* Country on its own line */}
{park.location.country && (
<div>{park.location.country}</div>
)}
</div>
</div>