This commit is contained in:
root
2025-12-20 19:00:42 +01:00
parent 9871289bfb
commit e1a0966dee
23 changed files with 1878 additions and 48 deletions

View File

@@ -1,3 +1,7 @@
'use client'
import { useEffect, Suspense } from 'react'
import { useSearchParams } from 'next/navigation'
import Nav from './components/Nav'
import Drop from './components/Drop'
import InfoBox from './components/InfoBox'
@@ -5,9 +9,33 @@ import Signup from './components/Signup'
import PastDrops from './components/PastDrops'
import Footer from './components/Footer'
function PaymentHandler() {
const searchParams = useSearchParams()
useEffect(() => {
const payment = searchParams.get('payment')
const orderId = searchParams.get('order_id')
if (payment === 'success' && orderId) {
// Clean up URL - IPN is handled by external service
window.history.replaceState({}, '', window.location.pathname)
} else if (payment === 'cancelled') {
alert('Payment was cancelled.')
// Clean up URL
window.history.replaceState({}, '', window.location.pathname)
}
}, [searchParams])
return null
}
export default function Home() {
return (
<>
<Suspense fallback={null}>
<PaymentHandler />
</Suspense>
<Nav />
<header className="container">
<h1>Shop together. Wholesale prices for private buyers.</h1>