Merge version_2 into main #2
@@ -2,6 +2,7 @@
|
||||
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import ReactLenis from "lenis/react";
|
||||
import { useState } from "react";
|
||||
import ContactSplitForm from '@/components/sections/contact/ContactSplitForm';
|
||||
import FeatureCardEight from '@/components/sections/feature/FeatureCardEight';
|
||||
import FooterLogoReveal from '@/components/sections/footer/FooterLogoReveal';
|
||||
@@ -11,9 +12,20 @@ import NavbarLayoutFloatingInline from '@/components/navbar/NavbarLayoutFloating
|
||||
import ProductCardThree from '@/components/sections/product/ProductCardThree';
|
||||
import TestimonialCardSixteen from '@/components/sections/testimonial/TestimonialCardSixteen';
|
||||
import TextAbout from '@/components/sections/about/TextAbout';
|
||||
import ProductCart from '@/components/ecommerce/cart/ProductCart';
|
||||
import { Leaf, Sparkles } from "lucide-react";
|
||||
|
||||
export default function LandingPage() {
|
||||
const [isCartOpen, setIsCartOpen] = useState(false);
|
||||
const [cartItems, setCartItems] = useState<Array<{ id: string, name: string, price: string, quantity: number, imageSrc: string }>>([
|
||||
{ id: "p1", name: "Organic Red Apples", price: "$4.99", quantity: 1, imageSrc: "http://img.b2bpic.net/free-photo/beautifully-arranged-apples-shop_23-2150713426.jpg" }
|
||||
]);
|
||||
|
||||
const handleWhatsAppCheckout = () => {
|
||||
const message = `New Order from FreshMarket:\n${cartItems.map(item => `- ${item.name} (x${item.quantity}) - ${item.price}`).join('\n')}\nTotal: $${cartItems.reduce((acc, item) => acc + parseFloat(item.price.replace('$', '')) * item.quantity, 0).toFixed(2)}`;
|
||||
window.open(`https://wa.me/1234567890?text=${encodeURIComponent(message)}`, '_blank');
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="bounce-effect"
|
||||
@@ -39,10 +51,18 @@ export default function LandingPage() {
|
||||
{ name: "Contact", id: "contact" },
|
||||
]}
|
||||
brandName="FreshMarket"
|
||||
button={{ text: "Shop Now" }}
|
||||
button={{ text: "Cart", onClick: () => setIsCartOpen(true) }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ProductCart
|
||||
isOpen={isCartOpen}
|
||||
onClose={() => setIsCartOpen(false)}
|
||||
items={cartItems}
|
||||
total={cartItems.reduce((acc, item) => acc + parseFloat(item.price.replace('$', '')) * item.quantity, 0).toFixed(2)}
|
||||
buttons={[{ text: "Checkout via WhatsApp", onClick: handleWhatsAppCheckout }]}
|
||||
/>
|
||||
|
||||
<div id="hero" data-section="hero">
|
||||
<HeroSplitDualMedia
|
||||
background={{ variant: "gradient-bars" }}
|
||||
@@ -161,4 +181,4 @@ export default function LandingPage() {
|
||||
</ReactLenis>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user