diff --git a/src/components/homepage/ContentTabs.tsx b/src/components/homepage/ContentTabs.tsx index 4124a1d1..a2916f4f 100644 --- a/src/components/homepage/ContentTabs.tsx +++ b/src/components/homepage/ContentTabs.tsx @@ -108,115 +108,121 @@ export function ContentTabs() { ).join(' '); }; - const RideCard = ({ ride }: { ride: Ride }) => ( - navigate(`/parks/${ride.park?.slug}/rides/${ride.slug}`)} - > -
- {/* Image/Icon Section */} -
- {ride.image_url ? ( - {ride.name} - ) : ( -
- {getRideIcon(ride.category)} + const RideCard = ({ ride }: { ride: Ride }) => { + const handleRideClick = () => { + navigate(`/parks/${ride.park?.slug}/rides/${ride.slug}`); + }; + + return ( + +
+ {/* Image/Icon Section */} +
+ {ride.image_url ? ( + {ride.name} + ) : ( +
+ {getRideIcon(ride.category)} +
+ )} + + {/* Gradient Overlay */} +
+ + {/* Status Badge */} + + {ride.status.replace('_', ' ').toUpperCase()} + +
+ + + {/* Header */} +
+
+

+ {ride.name} +

+ {getRideIcon(ride.category)} +
+ + {ride.park?.name && ( +
+ + {ride.park.name} + {ride.park.location?.city && `, ${ride.park.location.city}`} +
+ )}
- )} - - {/* Gradient Overlay */} -
- - {/* Status Badge */} - - {ride.status.replace('_', ' ').toUpperCase()} - + + {/* Description */} + {ride.description && ( +

+ {ride.description} +

+ )} + + {/* Category Badge */} + + {formatCategory(ride.category)} + + + {/* Stats */} +
+
+ {ride.max_speed_kmh && ( +
+ + + + +
+ )} + {ride.max_height_meters && ( +
+ + + +
+ )} + {ride.duration_seconds && ( +
+ + {Math.floor(ride.duration_seconds / 60)} + min +
+ )} +
+ + {ride.average_rating > 0 && ( +
+ + {ride.average_rating.toFixed(1)} + ({ride.review_count}) +
+ )} +
+ + {/* Action Button */} + +
- - - {/* Header */} -
-
-

- {ride.name} -

- {getRideIcon(ride.category)} -
- - {ride.park?.name && ( -
- - {ride.park.name} - {ride.park.location?.city && `, ${ride.park.location.city}`} -
- )} -
- - {/* Description */} - {ride.description && ( -

- {ride.description} -

- )} - - {/* Category Badge */} - - {formatCategory(ride.category)} - - - {/* Stats */} -
-
- {ride.max_speed_kmh && ( -
- - - - -
- )} - {ride.max_height_meters && ( -
- - - -
- )} - {ride.duration_seconds && ( -
- - {Math.floor(ride.duration_seconds / 60)} - min -
- )} -
- - {ride.average_rating > 0 && ( -
- - {ride.average_rating.toFixed(1)} - ({ride.review_count}) -
- )} -
- - {/* Action Button */} - -
-
- - ); + + ); + }; if (loading) { return ( @@ -269,7 +275,7 @@ export function ContentTabs() {
{popularParks.map((park) => ( - navigate(`/parks/${park.slug}`)} /> + ))}
@@ -281,7 +287,7 @@ export function ContentTabs() {
{trendingParks.map((park) => ( - navigate(`/parks/${park.slug}`)} /> + ))}
@@ -317,7 +323,7 @@ export function ContentTabs() {
{recentParks.map((park) => ( - navigate(`/parks/${park.slug}`)} /> + ))}
diff --git a/src/components/parks/ParkCard.tsx b/src/components/parks/ParkCard.tsx index 9831e21e..db6808be 100644 --- a/src/components/parks/ParkCard.tsx +++ b/src/components/parks/ParkCard.tsx @@ -1,16 +1,19 @@ import { MapPin, Star, Users, Clock, Castle, FerrisWheel, Waves, Tent } from 'lucide-react'; +import { useNavigate } from 'react-router-dom'; import { Card, CardContent } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Park } from '@/types/database'; + interface ParkCardProps { park: Park; - onClick?: () => void; } -export function ParkCard({ - park, - onClick -}: ParkCardProps) { +export function ParkCard({ park }: ParkCardProps) { + const navigate = useNavigate(); + + const handleClick = () => { + navigate(`/parks/${park.slug}`); + }; const getStatusColor = (status: string) => { switch (status) { case 'operating': @@ -40,7 +43,7 @@ export function ParkCard({ const formatParkType = (type: string) => { return type.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' '); }; - return + return
{/* Image Placeholder with Gradient */}
diff --git a/src/components/parks/ParkGrid.tsx b/src/components/parks/ParkGrid.tsx index 6e445104..b2efab30 100644 --- a/src/components/parks/ParkGrid.tsx +++ b/src/components/parks/ParkGrid.tsx @@ -255,10 +255,6 @@ export function ParkGrid() { { - // Navigate to park detail page - console.log('Navigate to park:', park.slug); - }} /> ))}
diff --git a/src/components/parks/ParkGridView.tsx b/src/components/parks/ParkGridView.tsx index e8e7a8f0..36127f14 100644 --- a/src/components/parks/ParkGridView.tsx +++ b/src/components/parks/ParkGridView.tsx @@ -3,17 +3,15 @@ import { Park } from '@/types/database'; interface ParkGridViewProps { parks: Park[]; - onParkClick: (park: Park) => void; } -export function ParkGridView({ parks, onParkClick }: ParkGridViewProps) { +export function ParkGridView({ parks }: ParkGridViewProps) { return (
{parks.map((park) => ( onParkClick(park)} /> ))}
diff --git a/src/pages/Parks.tsx b/src/pages/Parks.tsx index 1a6cdb22..9adc7c96 100644 --- a/src/pages/Parks.tsx +++ b/src/pages/Parks.tsx @@ -354,7 +354,6 @@ export default function Parks() { {viewMode === 'grid' ? ( ) : (