Move registration form to root path, remove /register

Registration page now lives at / instead of /register.
Updated all links and embed snippet accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-19 15:35:37 -07:00
parent 759b7295bc
commit 8a8c621532
5 changed files with 587 additions and 592 deletions

View File

@ -13,7 +13,7 @@ Adapted from `crypto-commons-gather.ing-website` with centralized config.
- **Key pattern**: All event-specific config centralized in `lib/event.config.ts`
## Flow
1. User clicks "Register" button on `www.collaborative-finance.net` → opens `register.collaborative-finance.net/register`
1. User clicks "Register" button on `www.collaborative-finance.net` → opens `register.collaborative-finance.net`
2. User fills form → POST `/api/register` → Google Sheets (Pending)
3. User picks accommodation/payment → POST `/api/create-checkout-session` → Mollie redirect
4. Mollie webhook POST `/api/webhook` → verify payment → assign booking → update sheet → email → Listmonk
@ -32,7 +32,7 @@ that links to the registration page. No iframe, no JS, no CORS — just a simple
## Dev Workflow
```bash
pnpm install
pnpm dev # localhost:3000 → redirects to /register
pnpm dev # localhost:3000 → registration form
```
## Deployment

View File

@ -1,5 +1,584 @@
import { redirect } from "next/navigation"
"use client"
export default function Home() {
redirect("/register")
import type React from "react"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Textarea } from "@/components/ui/textarea"
import { Checkbox } from "@/components/ui/checkbox"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
import Link from "next/link"
import { useState } from "react"
import {
EVENT_SHORT,
EVENT_FULL_NAME,
EVENT_DATES,
EVENT_LOCATION,
PRICING_TIERS,
PROCESSING_FEE_PERCENT,
ACCOMMODATION_VENUES,
ACCOMMODATION_MAP,
ACCOMMODATION_NIGHTS,
LINKS,
} from "@/lib/event.config"
// Determine current tier client-side
function getClientTier() {
const now = new Date().toISOString().slice(0, 10)
return PRICING_TIERS.find((t) => now < t.cutoff) ?? PRICING_TIERS[PRICING_TIERS.length - 1]
}
export default function RegisterPage() {
const [step, setStep] = useState<"form" | "payment">("form")
const [isSubmitting, setIsSubmitting] = useState(false)
const [includeAccommodation, setIncludeAccommodation] = useState(true)
const [wantFood, setWantFood] = useState(false)
const [selectedVenueKey, setSelectedVenueKey] = useState(ACCOMMODATION_VENUES[0]?.key || "")
const [accommodationType, setAccommodationType] = useState(
ACCOMMODATION_VENUES[0]?.options[0]?.id || ""
)
const [formData, setFormData] = useState({
name: "",
email: "",
contact: "",
contributions: "",
expectations: "",
howHeard: "",
dietary: [] as string[],
dietaryOther: "",
crewConsent: "",
})
const tier = getClientTier()
const baseTicketPrice = tier.price
const accommodationPrice = ACCOMMODATION_MAP[accommodationType]?.price ?? 0
const subtotalPrice =
baseTicketPrice +
(includeAccommodation ? accommodationPrice : 0)
const processingFee = Math.round(subtotalPrice * PROCESSING_FEE_PERCENT * 100) / 100
const totalPrice = subtotalPrice + processingFee
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
// Validate required fields
if (
!formData.name ||
!formData.email ||
!formData.contact ||
!formData.contributions ||
!formData.expectations ||
!formData.crewConsent
) {
alert("Please fill in all required fields")
return
}
setIsSubmitting(true)
try {
// Submit registration to Google Sheet first
const dietaryString =
formData.dietary.join(", ") +
(formData.dietaryOther ? `, ${formData.dietaryOther}` : "")
const response = await fetch("/api/register", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
name: formData.name,
email: formData.email,
contact: formData.contact,
contributions: formData.contributions,
expectations: formData.expectations,
howHeard: formData.howHeard,
dietary: dietaryString,
crewConsent: formData.crewConsent,
wantFood,
}),
})
if (!response.ok) {
throw new Error("Failed to record registration")
}
// Proceed to payment step
setStep("payment")
} catch (error) {
console.error("Registration error:", error)
alert("There was an error recording your registration. Please try again.")
} finally {
setIsSubmitting(false)
}
}
const handleDietaryChange = (value: string, checked: boolean) => {
setFormData((prev) => ({
...prev,
dietary: checked ? [...prev.dietary, value] : prev.dietary.filter((item) => item !== value),
}))
}
// Pricing summary line
const pricingSummary = PRICING_TIERS.map(
(t) => `${t.price} ${t.label}${t === tier ? " (current)" : ""}`
).join(" · ")
if (step === "payment") {
return (
<div className="min-h-screen bg-background">
{/* Header */}
<header className="border-b">
<div className="container mx-auto px-4 py-4">
<Link href={LINKS.website} className="text-2xl font-bold text-primary">
{EVENT_SHORT}
</Link>
</div>
</header>
<main className="container mx-auto px-4 py-12 max-w-5xl">
<div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold mb-4">Complete Your Registration</h1>
<p className="text-xl text-muted-foreground">Choose your payment method</p>
</div>
<Card className="mb-8 border-primary/40">
<CardHeader>
<CardTitle>Event Registration</CardTitle>
<CardDescription>
{pricingSummary}
</CardDescription>
</CardHeader>
<CardContent>
<div className="space-y-4">
{/* Ticket */}
<div className="flex items-start justify-between py-4 border-b border-border">
<div>
<div className="font-medium">{EVENT_SHORT} Ticket</div>
<div className="text-sm text-muted-foreground">
{pricingSummary}
</div>
</div>
<span className="text-lg font-semibold whitespace-nowrap ml-4">{baseTicketPrice.toFixed(2)}</span>
</div>
{/* Accommodation */}
<div className="py-4 border-b border-border">
<div className="flex items-start gap-3">
<Checkbox
id="include-accommodation"
checked={includeAccommodation}
onCheckedChange={(checked) => setIncludeAccommodation(checked as boolean)}
className="mt-1"
/>
<div className="flex-1">
<div className="flex justify-between items-start">
<Label htmlFor="include-accommodation" className="font-medium cursor-pointer">
Accommodation ({ACCOMMODATION_NIGHTS} nights)
</Label>
{includeAccommodation && (
<span className="text-lg font-semibold whitespace-nowrap ml-4">{accommodationPrice.toFixed(2)}</span>
)}
</div>
{includeAccommodation ? (
<div className="mt-3 space-y-4">
{/* Venue selection */}
<RadioGroup
value={selectedVenueKey}
onValueChange={(value: string) => {
setSelectedVenueKey(value)
const venue = ACCOMMODATION_VENUES.find((v) => v.key === value)
if (venue?.options[0]) {
setAccommodationType(venue.options[0].id)
}
}}
className="space-y-2"
>
{ACCOMMODATION_VENUES.map((venue) => (
<div key={venue.key} className="flex items-center space-x-2">
<RadioGroupItem value={venue.key} id={`venue-${venue.key}`} />
<Label htmlFor={`venue-${venue.key}`} className="font-medium cursor-pointer text-sm">
{venue.name}
</Label>
</div>
))}
</RadioGroup>
{/* Sub-options for selected venue */}
{ACCOMMODATION_VENUES.filter((v) => v.key === selectedVenueKey).map((venue) => (
<div key={venue.key} className="pl-6 border-l-2 border-primary/20">
<p className="text-xs text-muted-foreground mb-2">
{venue.description}
</p>
<RadioGroup
value={accommodationType}
onValueChange={setAccommodationType}
className="space-y-2"
>
{venue.options.map((opt) => (
<div key={opt.id} className="flex items-center space-x-2">
<RadioGroupItem value={opt.id} id={opt.id} />
<Label htmlFor={opt.id} className="font-normal cursor-pointer text-sm">
{opt.label} {opt.price.toFixed(2)} ({opt.nightlyRate}/night)
</Label>
</div>
))}
</RadioGroup>
</div>
))}
</div>
) : (
<p className="text-sm text-muted-foreground mt-1">
I&apos;ll arrange my own accommodation
</p>
)}
</div>
</div>
</div>
{includeAccommodation && (
<p className="text-xs text-muted-foreground bg-muted/50 rounded-lg p-3">
We&apos;ll follow up closer to the event to confirm room assignments and accommodation details.
</p>
)}
{/* Food */}
<div className="py-4 border-b border-border">
<div className="flex items-start gap-3">
<Checkbox
id="include-food"
checked={wantFood}
onCheckedChange={(checked) => setWantFood(checked as boolean)}
className="mt-1"
/>
<div className="flex-1">
<Label htmlFor="include-food" className="font-medium cursor-pointer">
I would like to include food
</Label>
<p className="text-sm text-muted-foreground mt-1">
More details and costs will be shared soon checking this box registers your interest
so we can plan accordingly. Your dietary preferences from step 1 have been noted.
</p>
</div>
</div>
</div>
{/* Processing fee */}
<div className="flex items-start justify-between py-3">
<div>
<div className="text-sm text-muted-foreground">Payment processing fee ({(PROCESSING_FEE_PERCENT * 100).toFixed(0)}%)</div>
</div>
<span className="text-sm text-muted-foreground whitespace-nowrap ml-4">{processingFee.toFixed(2)}</span>
</div>
{/* Total */}
<div className="flex justify-between items-center py-4 bg-primary/10 -mx-6 px-6 mt-4">
<div>
<div className="font-bold text-lg">Total Amount</div>
<div className="text-sm text-muted-foreground">
Ticket{includeAccommodation ? " + accommodation" : ""}
</div>
</div>
<span className="text-2xl font-bold text-primary">{totalPrice.toFixed(2)}</span>
</div>
</div>
</CardContent>
</Card>
{/* Payment Methods */}
<div className="space-y-6">
<Card>
<CardHeader>
<CardTitle>Payment Options</CardTitle>
<CardDescription>Choose your preferred payment method</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<form action="/api/create-checkout-session" method="POST">
<input type="hidden" name="registrationData" value={JSON.stringify(formData)} />
<input type="hidden" name="includeAccommodation" value={includeAccommodation ? "true" : "false"} />
<input type="hidden" name="accommodationType" value={accommodationType} />
<div className="space-y-4">
<p className="text-sm text-muted-foreground">
You'll be redirected to Mollie's secure checkout where you can pay by credit card,
SEPA bank transfer, iDEAL, PayPal, or other methods.
</p>
<div className="flex gap-3 pt-4">
<Button type="button" variant="outline" onClick={() => setStep("form")} className="flex-1">
Back to Form
</Button>
<Button type="submit" className="flex-1">
Proceed to Payment
</Button>
</div>
</div>
</form>
</CardContent>
</Card>
<div className="text-center text-sm text-muted-foreground">
<p>
All payments are processed securely through Mollie. You'll receive a confirmation email after successful
payment.
</p>
</div>
</div>
</main>
{/* Simplified Footer */}
<footer className="py-8 px-4 border-t border-border">
<div className="container mx-auto max-w-6xl text-center text-sm text-muted-foreground">
<p>
{EVENT_FULL_NAME} · {EVENT_DATES} · {EVENT_LOCATION}
</p>
<p className="mt-2">
<a href={LINKS.website} className="hover:text-foreground transition-colors">
{LINKS.website.replace("https://", "")}
</a>
{" · "}
<a href={`mailto:${LINKS.contactEmail}`} className="hover:text-foreground transition-colors">
{LINKS.contactEmail}
</a>
</p>
</div>
</footer>
</div>
)
}
return (
<div className="min-h-screen bg-background">
{/* Header */}
<header className="border-b">
<div className="container mx-auto px-4 py-4">
<Link href={LINKS.website} className="text-2xl font-bold text-primary">
{EVENT_SHORT}
</Link>
</div>
</header>
<main className="container mx-auto px-4 py-12 max-w-3xl">
<div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold mb-4">Register for {EVENT_SHORT}</h1>
<p className="text-xl text-muted-foreground">{EVENT_DATES} · {EVENT_LOCATION}</p>
</div>
<Card>
<CardHeader>
<CardTitle>Registration Form</CardTitle>
<CardDescription>Tell us about yourself and what you'd like to bring to {EVENT_SHORT}</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit} className="space-y-6">
{/* Name */}
<div className="space-y-2">
<Label htmlFor="name">What's your name? *</Label>
<Input
id="name"
required
value={formData.name}
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
/>
</div>
{/* Email */}
<div className="space-y-2">
<Label htmlFor="email">Email address *</Label>
<Input
id="email"
type="email"
required
placeholder="your@email.com"
value={formData.email}
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
/>
<p className="text-sm text-muted-foreground">
We&apos;ll send your registration confirmation and event updates here.
</p>
</div>
{/* Contact */}
<div className="space-y-2">
<Label htmlFor="contact">How can we contact you besides via email? *</Label>
<Input
id="contact"
required
placeholder="Telegram, Signal, phone, etc."
value={formData.contact}
onChange={(e) => setFormData({ ...formData, contact: e.target.value })}
/>
</div>
{/* Contributions */}
<div className="space-y-2">
<Label htmlFor="contributions">What do you want to contribute to {EVENT_SHORT}? *</Label>
<Textarea
id="contributions"
required
placeholder="This could be a talk, workshop, research inquiry, prototype, game, performance, etc."
className="min-h-[120px]"
value={formData.contributions}
onChange={(e) => setFormData({ ...formData, contributions: e.target.value })}
/>
<p className="text-sm text-muted-foreground">
This event is participant-driven each attendee is invited to co-create the program.
</p>
</div>
{/* Expectations */}
<div className="space-y-2">
<Label htmlFor="expectations">What do you expect to gain from participating? *</Label>
<Textarea
id="expectations"
required
placeholder="What are you looking for in particular?"
className="min-h-[100px]"
value={formData.expectations}
onChange={(e) => setFormData({ ...formData, expectations: e.target.value })}
/>
</div>
{/* How heard */}
<div className="space-y-2">
<Label htmlFor="howHeard">How did you hear about {EVENT_SHORT}?</Label>
<Input
id="howHeard"
placeholder="First timers: Did anyone recommend it to you?"
value={formData.howHeard}
onChange={(e) => setFormData({ ...formData, howHeard: e.target.value })}
/>
</div>
{/* Dietary Requirements */}
<div className="space-y-3">
<Label>Dietary Requirements</Label>
<p className="text-sm text-muted-foreground">
Do you have any special dietary requirements?
</p>
<div className="space-y-2">
{["vegetarian", "vegan", "gluten free", "lactose free"].map((diet) => (
<div key={diet} className="flex items-center space-x-2">
<Checkbox
id={diet}
checked={formData.dietary.includes(diet)}
onCheckedChange={(checked) => handleDietaryChange(diet, checked as boolean)}
/>
<Label htmlFor={diet} className="font-normal cursor-pointer">
{diet.charAt(0).toUpperCase() + diet.slice(1)}
</Label>
</div>
))}
<div className="flex items-start space-x-2 mt-2">
<Checkbox
id="other"
checked={!!formData.dietaryOther}
onCheckedChange={(checked) => {
if (!checked) setFormData({ ...formData, dietaryOther: "" })
}}
/>
<div className="flex-1">
<Label htmlFor="other" className="font-normal cursor-pointer">
Other:
</Label>
<Input
id="dietaryOther"
className="mt-1"
placeholder="Please specify..."
value={formData.dietaryOther}
onChange={(e) => setFormData({ ...formData, dietaryOther: e.target.value })}
/>
</div>
</div>
</div>
</div>
{/* Participation Consent */}
<div className="space-y-3">
<Label>Participation Commitment *</Label>
<div className="bg-muted p-4 rounded-lg space-y-2 text-sm">
<p>
{EVENT_SHORT} is a collaborative event participants co-create its program,
activities, and atmosphere together.
</p>
<p className="font-medium">
You will be expected to actively contribute to the event beyond just attending sessions.
</p>
</div>
<RadioGroup
required
value={formData.crewConsent}
onValueChange={(value) => setFormData({ ...formData, crewConsent: value })}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="cant-wait" id="cant-wait" />
<Label htmlFor="cant-wait" className="font-normal cursor-pointer">
Can't wait
</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="yes-please" id="yes-please" />
<Label htmlFor="yes-please" className="font-normal cursor-pointer">
Yes please, sign me up!
</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="love-it" id="love-it" />
<Label htmlFor="love-it" className="font-normal cursor-pointer">
I love getting my hands dirty :D
</Label>
</div>
</RadioGroup>
</div>
<div className="pt-4">
<Button type="submit" className="w-full" size="lg" disabled={isSubmitting}>
{isSubmitting ? "Recording registration..." : "Continue to Payment"}
</Button>
</div>
<div className="text-sm text-muted-foreground text-center">
<p>
Questions? Contact us at{" "}
<a href={`mailto:${LINKS.contactEmail}`} className="text-primary hover:underline">
{LINKS.contactEmail}
</a>
{LINKS.telegram && (
<>
{" or on "}
<a href={LINKS.telegram} className="text-primary hover:underline">
Telegram
</a>
</>
)}
</p>
</div>
</form>
</CardContent>
</Card>
</main>
{/* Simplified Footer */}
<footer className="py-8 px-4 border-t border-border">
<div className="container mx-auto max-w-6xl text-center text-sm text-muted-foreground">
<p>
{EVENT_FULL_NAME} · {EVENT_DATES} · {EVENT_LOCATION}
</p>
<p className="mt-2">
<a href={LINKS.website} className="hover:text-foreground transition-colors">
{LINKS.website.replace("https://", "")}
</a>
{" · "}
<a href={`mailto:${LINKS.contactEmail}`} className="hover:text-foreground transition-colors">
{LINKS.contactEmail}
</a>
</p>
</div>
</footer>
</div>
)
}

View File

@ -1,584 +0,0 @@
"use client"
import type React from "react"
import { Button } from "@/components/ui/button"
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Textarea } from "@/components/ui/textarea"
import { Checkbox } from "@/components/ui/checkbox"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"
import Link from "next/link"
import { useState } from "react"
import {
EVENT_SHORT,
EVENT_FULL_NAME,
EVENT_DATES,
EVENT_LOCATION,
PRICING_TIERS,
PROCESSING_FEE_PERCENT,
ACCOMMODATION_VENUES,
ACCOMMODATION_MAP,
ACCOMMODATION_NIGHTS,
LINKS,
} from "@/lib/event.config"
// Determine current tier client-side
function getClientTier() {
const now = new Date().toISOString().slice(0, 10)
return PRICING_TIERS.find((t) => now < t.cutoff) ?? PRICING_TIERS[PRICING_TIERS.length - 1]
}
export default function RegisterPage() {
const [step, setStep] = useState<"form" | "payment">("form")
const [isSubmitting, setIsSubmitting] = useState(false)
const [includeAccommodation, setIncludeAccommodation] = useState(true)
const [wantFood, setWantFood] = useState(false)
const [selectedVenueKey, setSelectedVenueKey] = useState(ACCOMMODATION_VENUES[0]?.key || "")
const [accommodationType, setAccommodationType] = useState(
ACCOMMODATION_VENUES[0]?.options[0]?.id || ""
)
const [formData, setFormData] = useState({
name: "",
email: "",
contact: "",
contributions: "",
expectations: "",
howHeard: "",
dietary: [] as string[],
dietaryOther: "",
crewConsent: "",
})
const tier = getClientTier()
const baseTicketPrice = tier.price
const accommodationPrice = ACCOMMODATION_MAP[accommodationType]?.price ?? 0
const subtotalPrice =
baseTicketPrice +
(includeAccommodation ? accommodationPrice : 0)
const processingFee = Math.round(subtotalPrice * PROCESSING_FEE_PERCENT * 100) / 100
const totalPrice = subtotalPrice + processingFee
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault()
// Validate required fields
if (
!formData.name ||
!formData.email ||
!formData.contact ||
!formData.contributions ||
!formData.expectations ||
!formData.crewConsent
) {
alert("Please fill in all required fields")
return
}
setIsSubmitting(true)
try {
// Submit registration to Google Sheet first
const dietaryString =
formData.dietary.join(", ") +
(formData.dietaryOther ? `, ${formData.dietaryOther}` : "")
const response = await fetch("/api/register", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
name: formData.name,
email: formData.email,
contact: formData.contact,
contributions: formData.contributions,
expectations: formData.expectations,
howHeard: formData.howHeard,
dietary: dietaryString,
crewConsent: formData.crewConsent,
wantFood,
}),
})
if (!response.ok) {
throw new Error("Failed to record registration")
}
// Proceed to payment step
setStep("payment")
} catch (error) {
console.error("Registration error:", error)
alert("There was an error recording your registration. Please try again.")
} finally {
setIsSubmitting(false)
}
}
const handleDietaryChange = (value: string, checked: boolean) => {
setFormData((prev) => ({
...prev,
dietary: checked ? [...prev.dietary, value] : prev.dietary.filter((item) => item !== value),
}))
}
// Pricing summary line
const pricingSummary = PRICING_TIERS.map(
(t) => `${t.price} ${t.label}${t === tier ? " (current)" : ""}`
).join(" · ")
if (step === "payment") {
return (
<div className="min-h-screen bg-background">
{/* Header */}
<header className="border-b">
<div className="container mx-auto px-4 py-4">
<Link href={LINKS.website} className="text-2xl font-bold text-primary">
{EVENT_SHORT}
</Link>
</div>
</header>
<main className="container mx-auto px-4 py-12 max-w-5xl">
<div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold mb-4">Complete Your Registration</h1>
<p className="text-xl text-muted-foreground">Choose your payment method</p>
</div>
<Card className="mb-8 border-primary/40">
<CardHeader>
<CardTitle>Event Registration</CardTitle>
<CardDescription>
{pricingSummary}
</CardDescription>
</CardHeader>
<CardContent>
<div className="space-y-4">
{/* Ticket */}
<div className="flex items-start justify-between py-4 border-b border-border">
<div>
<div className="font-medium">{EVENT_SHORT} Ticket</div>
<div className="text-sm text-muted-foreground">
{pricingSummary}
</div>
</div>
<span className="text-lg font-semibold whitespace-nowrap ml-4">{baseTicketPrice.toFixed(2)}</span>
</div>
{/* Accommodation */}
<div className="py-4 border-b border-border">
<div className="flex items-start gap-3">
<Checkbox
id="include-accommodation"
checked={includeAccommodation}
onCheckedChange={(checked) => setIncludeAccommodation(checked as boolean)}
className="mt-1"
/>
<div className="flex-1">
<div className="flex justify-between items-start">
<Label htmlFor="include-accommodation" className="font-medium cursor-pointer">
Accommodation ({ACCOMMODATION_NIGHTS} nights)
</Label>
{includeAccommodation && (
<span className="text-lg font-semibold whitespace-nowrap ml-4">{accommodationPrice.toFixed(2)}</span>
)}
</div>
{includeAccommodation ? (
<div className="mt-3 space-y-4">
{/* Venue selection */}
<RadioGroup
value={selectedVenueKey}
onValueChange={(value: string) => {
setSelectedVenueKey(value)
const venue = ACCOMMODATION_VENUES.find((v) => v.key === value)
if (venue?.options[0]) {
setAccommodationType(venue.options[0].id)
}
}}
className="space-y-2"
>
{ACCOMMODATION_VENUES.map((venue) => (
<div key={venue.key} className="flex items-center space-x-2">
<RadioGroupItem value={venue.key} id={`venue-${venue.key}`} />
<Label htmlFor={`venue-${venue.key}`} className="font-medium cursor-pointer text-sm">
{venue.name}
</Label>
</div>
))}
</RadioGroup>
{/* Sub-options for selected venue */}
{ACCOMMODATION_VENUES.filter((v) => v.key === selectedVenueKey).map((venue) => (
<div key={venue.key} className="pl-6 border-l-2 border-primary/20">
<p className="text-xs text-muted-foreground mb-2">
{venue.description}
</p>
<RadioGroup
value={accommodationType}
onValueChange={setAccommodationType}
className="space-y-2"
>
{venue.options.map((opt) => (
<div key={opt.id} className="flex items-center space-x-2">
<RadioGroupItem value={opt.id} id={opt.id} />
<Label htmlFor={opt.id} className="font-normal cursor-pointer text-sm">
{opt.label} {opt.price.toFixed(2)} ({opt.nightlyRate}/night)
</Label>
</div>
))}
</RadioGroup>
</div>
))}
</div>
) : (
<p className="text-sm text-muted-foreground mt-1">
I&apos;ll arrange my own accommodation
</p>
)}
</div>
</div>
</div>
{includeAccommodation && (
<p className="text-xs text-muted-foreground bg-muted/50 rounded-lg p-3">
We&apos;ll follow up closer to the event to confirm room assignments and accommodation details.
</p>
)}
{/* Food */}
<div className="py-4 border-b border-border">
<div className="flex items-start gap-3">
<Checkbox
id="include-food"
checked={wantFood}
onCheckedChange={(checked) => setWantFood(checked as boolean)}
className="mt-1"
/>
<div className="flex-1">
<Label htmlFor="include-food" className="font-medium cursor-pointer">
I would like to include food
</Label>
<p className="text-sm text-muted-foreground mt-1">
More details and costs will be shared soon checking this box registers your interest
so we can plan accordingly. Your dietary preferences from step 1 have been noted.
</p>
</div>
</div>
</div>
{/* Processing fee */}
<div className="flex items-start justify-between py-3">
<div>
<div className="text-sm text-muted-foreground">Payment processing fee ({(PROCESSING_FEE_PERCENT * 100).toFixed(0)}%)</div>
</div>
<span className="text-sm text-muted-foreground whitespace-nowrap ml-4">{processingFee.toFixed(2)}</span>
</div>
{/* Total */}
<div className="flex justify-between items-center py-4 bg-primary/10 -mx-6 px-6 mt-4">
<div>
<div className="font-bold text-lg">Total Amount</div>
<div className="text-sm text-muted-foreground">
Ticket{includeAccommodation ? " + accommodation" : ""}
</div>
</div>
<span className="text-2xl font-bold text-primary">{totalPrice.toFixed(2)}</span>
</div>
</div>
</CardContent>
</Card>
{/* Payment Methods */}
<div className="space-y-6">
<Card>
<CardHeader>
<CardTitle>Payment Options</CardTitle>
<CardDescription>Choose your preferred payment method</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
<form action="/api/create-checkout-session" method="POST">
<input type="hidden" name="registrationData" value={JSON.stringify(formData)} />
<input type="hidden" name="includeAccommodation" value={includeAccommodation ? "true" : "false"} />
<input type="hidden" name="accommodationType" value={accommodationType} />
<div className="space-y-4">
<p className="text-sm text-muted-foreground">
You'll be redirected to Mollie's secure checkout where you can pay by credit card,
SEPA bank transfer, iDEAL, PayPal, or other methods.
</p>
<div className="flex gap-3 pt-4">
<Button type="button" variant="outline" onClick={() => setStep("form")} className="flex-1">
Back to Form
</Button>
<Button type="submit" className="flex-1">
Proceed to Payment
</Button>
</div>
</div>
</form>
</CardContent>
</Card>
<div className="text-center text-sm text-muted-foreground">
<p>
All payments are processed securely through Mollie. You'll receive a confirmation email after successful
payment.
</p>
</div>
</div>
</main>
{/* Simplified Footer */}
<footer className="py-8 px-4 border-t border-border">
<div className="container mx-auto max-w-6xl text-center text-sm text-muted-foreground">
<p>
{EVENT_FULL_NAME} · {EVENT_DATES} · {EVENT_LOCATION}
</p>
<p className="mt-2">
<a href={LINKS.website} className="hover:text-foreground transition-colors">
{LINKS.website.replace("https://", "")}
</a>
{" · "}
<a href={`mailto:${LINKS.contactEmail}`} className="hover:text-foreground transition-colors">
{LINKS.contactEmail}
</a>
</p>
</div>
</footer>
</div>
)
}
return (
<div className="min-h-screen bg-background">
{/* Header */}
<header className="border-b">
<div className="container mx-auto px-4 py-4">
<Link href={LINKS.website} className="text-2xl font-bold text-primary">
{EVENT_SHORT}
</Link>
</div>
</header>
<main className="container mx-auto px-4 py-12 max-w-3xl">
<div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold mb-4">Register for {EVENT_SHORT}</h1>
<p className="text-xl text-muted-foreground">{EVENT_DATES} · {EVENT_LOCATION}</p>
</div>
<Card>
<CardHeader>
<CardTitle>Registration Form</CardTitle>
<CardDescription>Tell us about yourself and what you'd like to bring to {EVENT_SHORT}</CardDescription>
</CardHeader>
<CardContent>
<form onSubmit={handleSubmit} className="space-y-6">
{/* Name */}
<div className="space-y-2">
<Label htmlFor="name">What's your name? *</Label>
<Input
id="name"
required
value={formData.name}
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
/>
</div>
{/* Email */}
<div className="space-y-2">
<Label htmlFor="email">Email address *</Label>
<Input
id="email"
type="email"
required
placeholder="your@email.com"
value={formData.email}
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
/>
<p className="text-sm text-muted-foreground">
We&apos;ll send your registration confirmation and event updates here.
</p>
</div>
{/* Contact */}
<div className="space-y-2">
<Label htmlFor="contact">How can we contact you besides via email? *</Label>
<Input
id="contact"
required
placeholder="Telegram, Signal, phone, etc."
value={formData.contact}
onChange={(e) => setFormData({ ...formData, contact: e.target.value })}
/>
</div>
{/* Contributions */}
<div className="space-y-2">
<Label htmlFor="contributions">What do you want to contribute to {EVENT_SHORT}? *</Label>
<Textarea
id="contributions"
required
placeholder="This could be a talk, workshop, research inquiry, prototype, game, performance, etc."
className="min-h-[120px]"
value={formData.contributions}
onChange={(e) => setFormData({ ...formData, contributions: e.target.value })}
/>
<p className="text-sm text-muted-foreground">
This event is participant-driven each attendee is invited to co-create the program.
</p>
</div>
{/* Expectations */}
<div className="space-y-2">
<Label htmlFor="expectations">What do you expect to gain from participating? *</Label>
<Textarea
id="expectations"
required
placeholder="What are you looking for in particular?"
className="min-h-[100px]"
value={formData.expectations}
onChange={(e) => setFormData({ ...formData, expectations: e.target.value })}
/>
</div>
{/* How heard */}
<div className="space-y-2">
<Label htmlFor="howHeard">How did you hear about {EVENT_SHORT}?</Label>
<Input
id="howHeard"
placeholder="First timers: Did anyone recommend it to you?"
value={formData.howHeard}
onChange={(e) => setFormData({ ...formData, howHeard: e.target.value })}
/>
</div>
{/* Dietary Requirements */}
<div className="space-y-3">
<Label>Dietary Requirements</Label>
<p className="text-sm text-muted-foreground">
Do you have any special dietary requirements?
</p>
<div className="space-y-2">
{["vegetarian", "vegan", "gluten free", "lactose free"].map((diet) => (
<div key={diet} className="flex items-center space-x-2">
<Checkbox
id={diet}
checked={formData.dietary.includes(diet)}
onCheckedChange={(checked) => handleDietaryChange(diet, checked as boolean)}
/>
<Label htmlFor={diet} className="font-normal cursor-pointer">
{diet.charAt(0).toUpperCase() + diet.slice(1)}
</Label>
</div>
))}
<div className="flex items-start space-x-2 mt-2">
<Checkbox
id="other"
checked={!!formData.dietaryOther}
onCheckedChange={(checked) => {
if (!checked) setFormData({ ...formData, dietaryOther: "" })
}}
/>
<div className="flex-1">
<Label htmlFor="other" className="font-normal cursor-pointer">
Other:
</Label>
<Input
id="dietaryOther"
className="mt-1"
placeholder="Please specify..."
value={formData.dietaryOther}
onChange={(e) => setFormData({ ...formData, dietaryOther: e.target.value })}
/>
</div>
</div>
</div>
</div>
{/* Participation Consent */}
<div className="space-y-3">
<Label>Participation Commitment *</Label>
<div className="bg-muted p-4 rounded-lg space-y-2 text-sm">
<p>
{EVENT_SHORT} is a collaborative event participants co-create its program,
activities, and atmosphere together.
</p>
<p className="font-medium">
You will be expected to actively contribute to the event beyond just attending sessions.
</p>
</div>
<RadioGroup
required
value={formData.crewConsent}
onValueChange={(value) => setFormData({ ...formData, crewConsent: value })}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="cant-wait" id="cant-wait" />
<Label htmlFor="cant-wait" className="font-normal cursor-pointer">
Can't wait
</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="yes-please" id="yes-please" />
<Label htmlFor="yes-please" className="font-normal cursor-pointer">
Yes please, sign me up!
</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="love-it" id="love-it" />
<Label htmlFor="love-it" className="font-normal cursor-pointer">
I love getting my hands dirty :D
</Label>
</div>
</RadioGroup>
</div>
<div className="pt-4">
<Button type="submit" className="w-full" size="lg" disabled={isSubmitting}>
{isSubmitting ? "Recording registration..." : "Continue to Payment"}
</Button>
</div>
<div className="text-sm text-muted-foreground text-center">
<p>
Questions? Contact us at{" "}
<a href={`mailto:${LINKS.contactEmail}`} className="text-primary hover:underline">
{LINKS.contactEmail}
</a>
{LINKS.telegram && (
<>
{" or on "}
<a href={LINKS.telegram} className="text-primary hover:underline">
Telegram
</a>
</>
)}
</p>
</div>
</form>
</CardContent>
</Card>
</main>
{/* Simplified Footer */}
<footer className="py-8 px-4 border-t border-border">
<div className="container mx-auto max-w-6xl text-center text-sm text-muted-foreground">
<p>
{EVENT_FULL_NAME} · {EVENT_DATES} · {EVENT_LOCATION}
</p>
<p className="mt-2">
<a href={LINKS.website} className="hover:text-foreground transition-colors">
{LINKS.website.replace("https://", "")}
</a>
{" · "}
<a href={`mailto:${LINKS.contactEmail}`} className="hover:text-foreground transition-colors">
{LINKS.contactEmail}
</a>
</p>
</div>
</footer>
</div>
)
}

View File

@ -9,7 +9,7 @@
<!-- Option 1: Styled button (self-contained, no external CSS needed) -->
<a
href="https://register.collaborative-finance.net/register"
href="https://register.collaborative-finance.net"
style="
display: inline-block;
padding: 14px 32px;
@ -30,7 +30,7 @@
<!-- Option 2: Minimal link (use your own CSS) -->
<!--
<a href="https://register.collaborative-finance.net/register" class="your-button-class">
<a href="https://register.collaborative-finance.net" class="your-button-class">
Register for CoFi 2026
</a>
-->

View File

@ -179,7 +179,7 @@ export const EMAIL_BRANDING = {
export const LINKS = {
website: "https://www.collaborative-finance.net",
register: "https://register.collaborative-finance.net/register",
register: "https://register.collaborative-finance.net",
telegram: "", // TBD — set when community channel is created
community: "", // TBD — set when community channel is created
contactEmail: "cofi.gathering@gmail.com",