diff --git a/client/src/components/classes/class-card.tsx b/client/src/components/classes/class-card.tsx index 3bea44f..e5e501f 100644 --- a/client/src/components/classes/class-card.tsx +++ b/client/src/components/classes/class-card.tsx @@ -1,44 +1,17 @@ import { Class } from "@shared/schema"; -import { useAuth } from "@/hooks/use-auth"; -import { useState } from "react"; -import { useToast } from "@/hooks/use-toast"; -import { useLocation } from "wouter"; import FadiaGroupClassImage from "../../assets/Fadia-15.jpg"; import FadiaSmallGroupClassImage from "../../assets/Fadia-156.jpg"; import FadiaPrivateClassImage from "../../assets/Fadia-132.jpg"; interface ClassCardProps { classData: Class; - onBookClick: (classId: number) => void; } -export function ClassCard({ classData, onBookClick }: ClassCardProps) { - const { user } = useAuth(); - const { toast } = useToast(); - const [_, setLocation] = useLocation(); - - const formatPrice = (price: number) => { - return `$${(price / 100).toFixed(2)}`; - }; - +export function ClassCard({ classData }: ClassCardProps) { const formatDuration = (minutes: number) => { return `${minutes} minutes`; }; - const handleBookNow = () => { - if (!user) { - toast({ - title: "Authentication required", - description: "Please login or sign up to book a class", - variant: "destructive" - }); - setLocation("/auth"); - return; - } - - onBookClick(classData.id); - }; - // Determine badge color based on class type const badgeColor = () => { switch (classData.classType) { @@ -49,11 +22,6 @@ export function ClassCard({ classData, onBookClick }: ClassCardProps) { } }; - // All buttons use teal as the primary color - const buttonColor = () => { - return "bg-teal text-white"; - }; - // Format class type for display const formatClassType = (type: string) => { switch (type) { @@ -91,18 +59,11 @@ export function ClassCard({ classData, onBookClick }: ClassCardProps) {

{classData.description}

-
+
{formatDuration(classData.duration)} - {formatPrice(classData.price)} / class
-
); diff --git a/client/src/components/classes/classes-section.tsx b/client/src/components/classes/classes-section.tsx index 605616b..1c95654 100644 --- a/client/src/components/classes/classes-section.tsx +++ b/client/src/components/classes/classes-section.tsx @@ -1,30 +1,14 @@ -import { useState } from "react"; import { ClassCard } from "./class-card"; -import { BookingCalendar } from "./booking-calendar"; import { useQuery } from "@tanstack/react-query"; import { Class } from "@shared/schema"; import { Skeleton } from "@/components/ui/skeleton"; import FadiaClassImage from "../../assets/Fadia-156.jpg"; export function ClassesSection() { - const [selectedClassId, setSelectedClassId] = useState(null); - const { data: classes, isLoading, error } = useQuery({ queryKey: ["/api/classes"], }); - const selectedClass = selectedClassId - ? classes?.find(c => c.id === selectedClassId) - : null; - - const handleBookClick = (classId: number) => { - setSelectedClassId(classId); - const element = document.getElementById('booking-calendar'); - if (element) { - element.scrollIntoView({ behavior: 'smooth' }); - } - }; - return (
@@ -65,7 +49,6 @@ export function ClassesSection() { -
))} @@ -80,28 +63,10 @@ export function ClassesSection() { ))} )} - - {selectedClass && ( -
-

- Book Your {selectedClass.name} Class -

- -
- -
-
- )}
);