diff --git a/src/app/page.tsx b/src/app/page.tsx index f55e875..904415e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,6 +2,8 @@ import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import ReactLenis from "lenis/react"; +import { useState } from "react"; +import { ShoppingCart, X, Plus, Minus, Trash2 } from "lucide-react"; import ContactSplitForm from '@/components/sections/contact/ContactSplitForm'; import FaqDouble from '@/components/sections/faq/FaqDouble'; import FeatureCardTwentyOne from '@/components/sections/feature/FeatureCardTwentyOne'; @@ -14,6 +16,20 @@ import TestimonialCardSixteen from '@/components/sections/testimonial/Testimonia import TextAbout from '@/components/sections/about/TextAbout'; export default function LandingPage() { + const [isCartOpen, setIsCartOpen] = useState(false); + const [cart, setCart] = useState([]); + + const addToCart = (product: any) => { + setCart((prev) => { + const existing = prev.find((item) => item.id === product.id); + if (existing) { + return prev.map((item) => item.id === product.id ? { ...item, quantity: item.quantity + 1 } : item); + } + return [...prev, { ...product, quantity: 1 }]; + }); + setIsCartOpen(true); + }; + return ( + {isCartOpen && ( +
setIsCartOpen(false)}> +
e.stopPropagation()}> +
+

Dein Warenkorb

+ +
+ {cart.length === 0 ?

Warenkorb ist leer.

: ( +
+ {cart.map((item) => ( +
+ {item.name} +
+

{item.name}

+

{item.price} x {item.quantity}

+
+ +
+ ))} + +
+ )} +
+
+ )} @@ -88,9 +129,9 @@ export default function LandingPage() { gridVariant="uniform-all-items-equal" useInvertedBackground={false} products={[ - { id: "p1", name: "BABA Spezial Döner", price: "ab 8,50€", imageSrc: "http://img.b2bpic.net/free-photo/delicious-arabic-fast-food-meat-skewers-top-view_23-2148651131.jpg" }, - { id: "p2", name: "Steak Döner", price: "ab 9,50€", imageSrc: "http://img.b2bpic.net/free-photo/lahmajun-with-meat-mixed-vegetables_140725-1157.jpg" }, - { id: "p3", name: "Hausgemachter Lahmacun", price: "ab 6,00€", imageSrc: "http://img.b2bpic.net/free-photo/top-view-seed-bread-concept_23-2148648796.jpg" }, + { id: "p1", name: "BABA Spezial Döner", price: "ab 8,50€", imageSrc: "http://img.b2bpic.net/free-photo/delicious-arabic-fast-food-meat-skewers-top-view_23-2148651131.jpg", onProductClick: () => addToCart({ id: "p1", name: "BABA Spezial Döner", price: "8,50€", imageSrc: "http://img.b2bpic.net/free-photo/delicious-arabic-fast-food-meat-skewers-top-view_23-2148651131.jpg" }) }, + { id: "p2", name: "Steak Döner", price: "ab 9,50€", imageSrc: "http://img.b2bpic.net/free-photo/lahmajun-with-meat-mixed-vegetables_140725-1157.jpg", onProductClick: () => addToCart({ id: "p2", name: "Steak Döner", price: "9,50€", imageSrc: "http://img.b2bpic.net/free-photo/lahmajun-with-meat-mixed-vegetables_140725-1157.jpg" }) }, + { id: "p3", name: "Hausgemachter Lahmacun", price: "ab 6,00€", imageSrc: "http://img.b2bpic.net/free-photo/top-view-seed-bread-concept_23-2148648796.jpg", onProductClick: () => addToCart({ id: "p3", name: "Hausgemachter Lahmacun", price: "6,00€", imageSrc: "http://img.b2bpic.net/free-photo/top-view-seed-bread-concept_23-2148648796.jpg" }) }, { id: "p4", name: "Sesam-Sauerteigbrot", price: "ab 2,50€", imageSrc: "http://img.b2bpic.net/free-photo/close-up-caesar-salad-with-fresh-lettuce-parmesan-fried-croutons-roast-beef_176474-901.jpg" }, { id: "p5", name: "Veggie Mix", price: "ab 7,50€", imageSrc: "http://img.b2bpic.net/free-photo/meat-steaks-with-fried-potatoes-rice-garnish-inside-white-plate_114579-4421.jpg" }, { id: "p6", name: "Döner-Box Spezial", price: "ab 8,00€", imageSrc: "http://img.b2bpic.net/free-photo/meat-kabab-served-with-mangal-salad-onions-greens-pickles_140725-7975.jpg" }, @@ -165,10 +206,10 @@ export default function LandingPage() { logoText="BABA Kebab" columns={[ { - title: "Menü", items: [{ label: "Steak-Döner", href: "#products" }, { label: "Spezial-Döner", href: "#products" }], + title: "Menü", items: [{ label: "Steak-Döner", href: "#products" }, { label: "Spezial-Döner", href: "#products" }], }, { - title: "Über", items: [{ label: "Unsere Story", href: "#about" }, { label: "Kontakt", href: "#contact" }], + title: "Über", items: [{ label: "Unsere Story", href: "#about" }, { label: "Kontakt", href: "#contact" }], }, ]} /> @@ -176,4 +217,4 @@ export default function LandingPage() {
); -} +} \ No newline at end of file