Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 345a5a10b3 | |||
| d132af22ff | |||
| 331fd46dc4 | |||
| 6137c6ceb5 | |||
| 6ce3774d62 |
@@ -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?_wi=1" }
|
||||
]);
|
||||
|
||||
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" }}
|
||||
@@ -95,7 +115,7 @@ export default function LandingPage() {
|
||||
gridVariant="three-columns-all-equal-width"
|
||||
useInvertedBackground={false}
|
||||
products={[
|
||||
{ id: "p1", name: "Organic Red Apples", price: "$4.99/kg", imageSrc: "http://img.b2bpic.net/free-photo/beautifully-arranged-apples-shop_23-2150713426.jpg" },
|
||||
{ id: "p1", name: "Organic Red Apples", price: "$4.99/kg", imageSrc: "http://img.b2bpic.net/free-photo/beautifully-arranged-apples-shop_23-2150713426.jpg?_wi=2" },
|
||||
{ id: "p2", name: "Fresh Kale", price: "$2.50/bunch", imageSrc: "http://img.b2bpic.net/free-photo/broccoli-inflorescences-laid-out-gray-background-top-view-healthy-vegetable-products-food-delivery-from-farms_166373-1849.jpg" },
|
||||
{ id: "p3", name: "Artisan Sourdough Bread", price: "$6.00", imageSrc: "http://img.b2bpic.net/free-photo/close-up-freshly-baked-loaf-bread_23-2152015863.jpg" }
|
||||
]}
|
||||
@@ -161,4 +181,4 @@ export default function LandingPage() {
|
||||
</ReactLenis>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user