From d23d1c5c3b3f9de72a4c018cac402bbaaff738bf Mon Sep 17 00:00:00 2001 From: development Date: Tue, 13 Jan 2026 13:43:19 +0000 Subject: [PATCH 1/2] Update src/app/layout.tsx --- src/app/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index fe5ddf9..e27dd63 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1264,4 +1264,4 @@ export default function RootLayout({ ); -} \ No newline at end of file +} -- 2.49.1 From 0a45ac622cc854040a2cb8a5e10d4b074571156a Mon Sep 17 00:00:00 2001 From: development Date: Tue, 13 Jan 2026 13:43:20 +0000 Subject: [PATCH 2/2] Update src/app/page.tsx --- src/app/page.tsx | 75 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 7b9ff47..18d8e64 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,4 +1,4 @@ -"use client" +"use client"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleMinimal from '@/components/navbar/NavbarStyleMinimal'; @@ -12,8 +12,55 @@ import BlogCardTwo from '@/components/sections/blog/BlogCardTwo'; import ContactCenter from '@/components/sections/contact/ContactCenter'; import FooterBaseSocial from '@/components/sections/footer/FooterBaseSocial'; import { Flame, Users, CheckCircle, Heart, Sparkles, Mail, Instagram, Facebook, Youtube, Twitter } from "lucide-react"; +import { loadStripe } from '@stripe/stripe-js'; +import { useState } from 'react'; + +const stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY || ''); export default function LandingPage() { + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + + const handlePayment = async () => { + try { + setLoading(true); + setError(null); + + const response = await fetch('/api/create-checkout-session', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ + amount: 50, + }), + }); + + if (!response.ok) { + throw new Error('Failed to create checkout session'); + } + + const { sessionId } = await response.json(); + const stripe = await stripePromise; + + if (!stripe) { + throw new Error('Stripe failed to load'); + } + + const { error: redirectError } = await stripe.redirectToCheckout({ + sessionId, + }); + + if (redirectError) { + setError(redirectError.message || 'Payment failed'); + } + } catch (err) { + setError(err instanceof Error ? err.message : 'Payment error occurred'); + } finally { + setLoading(false); + } + }; + return ( +
+
+
+

Premium Experience

+

Get exclusive access to premium recipes and advanced meal planning features.

+
+
+
$50
+

One-time payment for lifetime access

+ + {error && ( +

{error}

+ )} +
+

Secure payment powered by Stripe

+
+
+