From c194cfa8520d3697fef01a12fed3981735d0ffea Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Mon, 15 Jun 2026 12:38:53 +0000 Subject: [PATCH] Bob AI: Added interactive menu section with WhatsApp checkout --- src/pages/HomePage.tsx | 123 +++-------------- src/pages/HomePage/sections/About.tsx | 26 ++++ src/pages/HomePage/sections/Contact.tsx | 21 +++ src/pages/HomePage/sections/Faq.tsx | 26 ++++ src/pages/HomePage/sections/Hero.tsx | 32 +++++ src/pages/HomePage/sections/Menu.tsx | 173 ++++++++++++++++++++++++ src/pages/HomePage/sections/Reviews.tsx | 27 ++++ 7 files changed, 325 insertions(+), 103 deletions(-) create mode 100644 src/pages/HomePage/sections/About.tsx create mode 100644 src/pages/HomePage/sections/Contact.tsx create mode 100644 src/pages/HomePage/sections/Faq.tsx create mode 100644 src/pages/HomePage/sections/Hero.tsx create mode 100644 src/pages/HomePage/sections/Menu.tsx create mode 100644 src/pages/HomePage/sections/Reviews.tsx diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 5ff8c5e..09ecccc 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -1,113 +1,30 @@ -import AboutFeaturesSplit from '@/components/sections/about/AboutFeaturesSplit'; -import ContactCta from '@/components/sections/contact/ContactCta'; -import FaqTwoColumn from '@/components/sections/faq/FaqTwoColumn'; -import FeaturesMediaCarousel from '@/components/sections/features/FeaturesMediaCarousel'; -import HeroBillboardCarousel from '@/components/sections/hero/HeroBillboardCarousel'; -import TestimonialColumnMarqueeCards from '@/components/sections/testimonial/TestimonialColumnMarqueeCards'; -import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; +// AUTO-GENERATED shell by per-section-migrate. +// Section bodies live in .//sections/.tsx. Edit the section +// files directly. Non-block content (wrappers, non-inlinable sections) is +// preserved inline; extracted section blocks become refs. -export default function HomePage() { +import React from 'react'; +import HeroSection from './HomePage/sections/Hero'; +import AboutSection from './HomePage/sections/About'; +import ReviewsSection from './HomePage/sections/Reviews'; +import FaqSection from './HomePage/sections/Faq'; +import ContactSection from './HomePage/sections/Contact'; + + +import MenuSection from './HomePage/sections/Menu';export default function HomePage(): React.JSX.Element { return ( - <> -
- - - -
+<> + -
- - - -
+ + - -
- - - -
+ -
- - - -
+ -
- - - -
+ ); } diff --git a/src/pages/HomePage/sections/About.tsx b/src/pages/HomePage/sections/About.tsx new file mode 100644 index 0000000..8e7203c --- /dev/null +++ b/src/pages/HomePage/sections/About.tsx @@ -0,0 +1,26 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "about" section. + +import React from 'react'; +import AboutFeaturesSplit from '@/components/sections/about/AboutFeaturesSplit'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function AboutSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Contact.tsx b/src/pages/HomePage/sections/Contact.tsx new file mode 100644 index 0000000..34f2946 --- /dev/null +++ b/src/pages/HomePage/sections/Contact.tsx @@ -0,0 +1,21 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "contact" section. + +import React from 'react'; +import ContactCta from '@/components/sections/contact/ContactCta'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function ContactSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Faq.tsx b/src/pages/HomePage/sections/Faq.tsx new file mode 100644 index 0000000..4b38ad8 --- /dev/null +++ b/src/pages/HomePage/sections/Faq.tsx @@ -0,0 +1,26 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "faq" section. + +import React from 'react'; +import FaqTwoColumn from '@/components/sections/faq/FaqTwoColumn'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function FaqSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Hero.tsx b/src/pages/HomePage/sections/Hero.tsx new file mode 100644 index 0000000..9ac92ed --- /dev/null +++ b/src/pages/HomePage/sections/Hero.tsx @@ -0,0 +1,32 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "hero" section. + +import React from 'react'; +import HeroBillboardCarousel from '@/components/sections/hero/HeroBillboardCarousel'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function HeroSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} diff --git a/src/pages/HomePage/sections/Menu.tsx b/src/pages/HomePage/sections/Menu.tsx new file mode 100644 index 0000000..c971ef0 --- /dev/null +++ b/src/pages/HomePage/sections/Menu.tsx @@ -0,0 +1,173 @@ +import React, { useState } from 'react'; +import { Plus, Minus, ShoppingCart } from 'lucide-react'; +import Button from '@/components/ui/Button'; +import ImageOrVideo from '@/components/ui/ImageOrVideo'; +import TextAnimation from '@/components/ui/TextAnimation'; +import ScrollReveal from '@/components/ui/ScrollReveal'; + +const MENU_ITEMS = [ + { id: 1, name: "Wada Misal Pav", price: 120, imageSrc: "http://img.b2bpic.net/free-photo/high-angle-delicious-pakistan-meal-basket_23-2148821575.jpg", description: "Our most popular signature dish. Fiery rassa, crispy farsan, and soft, buttery pav." }, + { id: 2, name: "Solkadi", price: 50, imageSrc: "http://img.b2bpic.net/free-photo/glasses-refreshing-hibiscus-ice-tea_23-2149893654.jpg", description: "Cool, refreshing kokum-based drink that balances every spicy bite." }, + { id: 3, name: "Misal Thali", price: 180, imageSrc: "http://img.b2bpic.net/free-photo/high-angle-indian-food-assortment_23-2148747704.jpg", description: "The ultimate loaded experience featuring all our signature sides and accompaniments." }, + { id: 4, name: "Traditional Misal", price: 100, imageSrc: "http://img.b2bpic.net/free-photo/closeup-shot-indian-tasty-food-called-marwari-veg-thali-wooden-table_181624-58043.jpg", description: "The classic breakfast choice of Kolhapur, perfected over decades." }, + { id: 5, name: "Butter Pav", price: 30, imageSrc: "http://img.b2bpic.net/free-photo/dragon-fruit-with-juice-tray-wooden-table-plaster-wall-high-angle-view_176474-9420.jpg", description: "Freshly baked, soft pav toasted with authentic local butter." }, + { id: 6, name: "Curd Sides", price: 40, imageSrc: "http://img.b2bpic.net/free-photo/assortment-indian-dishes-platter_23-2152002848.jpg", description: "Fresh homemade curd served with every thali to soothe the palate." }, +]; + +export default function MenuSection() { + const [cart, setCart] = useState>({}); + + const updateQuantity = (id: number, delta: number) => { + setCart(prev => { + const current = prev[id] || 0; + const next = Math.max(0, current + delta); + if (next === 0) { + const { [id]: _, ...rest } = prev; + return rest; + } + return { ...prev, [id]: next }; + }); + }; + + const totalItems = Object.values(cart).reduce((a, b) => a + b, 0); + const totalPrice = Object.entries(cart).reduce((total, [id, qty]) => { + const item = MENU_ITEMS.find(i => i.id === Number(id)); + return total + (item ? item.price * qty : 0); + }, 0); + + const handleCheckout = () => { + if (totalItems === 0) return; + + let message = "Hello! I would like to place an order for home delivery:\n\n"; + Object.entries(cart).forEach(([id, qty]) => { + const item = MENU_ITEMS.find(i => i.id === Number(id)); + if (item) { + message += `${qty}x ${item.name} - ₹${item.price * qty}\n`; + } + }); + message += `\nTotal: ₹${totalPrice}\n\nPlease let me know the delivery time and payment details.`; + + const encodedMessage = encodeURIComponent(message); + window.open(`https://wa.me/919876543210?text=${encodedMessage}`, '_blank'); + }; + + return ( +
+ +
+ ); +} \ No newline at end of file diff --git a/src/pages/HomePage/sections/Reviews.tsx b/src/pages/HomePage/sections/Reviews.tsx new file mode 100644 index 0000000..d4ebd69 --- /dev/null +++ b/src/pages/HomePage/sections/Reviews.tsx @@ -0,0 +1,27 @@ +// AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this +// file as the canonical source for the "reviews" section. + +import React from 'react'; +import TestimonialColumnMarqueeCards from '@/components/sections/testimonial/TestimonialColumnMarqueeCards'; +import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; + +export default function ReviewsSection(): React.JSX.Element { + return ( +
+ + + +
+ ); +} -- 2.49.1