430 lines
19 KiB
TypeScript
430 lines
19 KiB
TypeScript
"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"
|
|
|
|
export default function RegisterPage() {
|
|
const [step, setStep] = useState<"form" | "payment">("form")
|
|
const [formData, setFormData] = useState({
|
|
name: "",
|
|
contact: "",
|
|
contributions: "",
|
|
expectations: "",
|
|
howHeard: "",
|
|
dietary: [] as string[],
|
|
dietaryOther: "",
|
|
crewConsent: "",
|
|
})
|
|
const [packages, setPackages] = useState({
|
|
accommodation: false,
|
|
food: false,
|
|
})
|
|
|
|
const baseTicketPrice = 80 // Updated to early bird price €80
|
|
const accommodationPrice = 39.2 * 6 // Updated to €39.20/night * 6 nights = €235.20
|
|
const foodPrice = 35 * 3 + 10 * 3 // Updated to reflect catered (€35*3) + self-organized (€10*3) = €135
|
|
const calculateTotal = () => {
|
|
let total = baseTicketPrice
|
|
if (packages.accommodation) total += accommodationPrice
|
|
if (packages.food) total += foodPrice
|
|
return total
|
|
}
|
|
|
|
const handleSubmit = (e: React.FormEvent) => {
|
|
e.preventDefault()
|
|
// Validate required fields
|
|
if (
|
|
!formData.name ||
|
|
!formData.contact ||
|
|
!formData.contributions ||
|
|
!formData.expectations ||
|
|
!formData.crewConsent
|
|
) {
|
|
alert("Please fill in all required fields")
|
|
return
|
|
}
|
|
setStep("payment")
|
|
}
|
|
|
|
const handleDietaryChange = (value: string, checked: boolean) => {
|
|
setFormData((prev) => ({
|
|
...prev,
|
|
dietary: checked ? [...prev.dietary, value] : prev.dietary.filter((item) => item !== value),
|
|
}))
|
|
}
|
|
|
|
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="/" className="text-2xl font-bold text-primary">
|
|
CCG
|
|
</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">Select packages and payment method</p>
|
|
</div>
|
|
|
|
<Card className="mb-8 border-primary/40">
|
|
<CardHeader>
|
|
<CardTitle>Select Your Packages</CardTitle>
|
|
<CardDescription>
|
|
Ticket is required (€80 early bird until Dec 31, 2025). Add accommodation and food as needed.
|
|
</CardDescription>
|
|
</CardHeader>
|
|
<CardContent>
|
|
<div className="space-y-4">
|
|
{/* Ticket (required) */}
|
|
<div className="flex items-start justify-between py-4 border-b border-border">
|
|
<div className="flex items-start gap-3">
|
|
<Checkbox checked disabled className="mt-1" />
|
|
<div>
|
|
<div className="font-medium">CCG 2026 Ticket (Required)</div>
|
|
<div className="text-sm text-muted-foreground">
|
|
€80 Early bird (until Dec 31, 2025) • €120 Regular (Jan-Jun 2026) • €150 Late (after Jul 1,
|
|
2026)
|
|
</div>
|
|
<div className="text-xs text-muted-foreground mt-1">
|
|
CCA members: Bring two newcomers, get a free ticket!
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<span className="text-lg font-semibold">€{baseTicketPrice}.00</span>
|
|
</div>
|
|
|
|
{/* Accommodation */}
|
|
<div className="flex items-start justify-between py-4 border-b border-border">
|
|
<div className="flex items-start gap-3">
|
|
<Checkbox
|
|
id="accommodation"
|
|
checked={packages.accommodation}
|
|
onCheckedChange={(checked) => setPackages({ ...packages, accommodation: checked as boolean })}
|
|
className="mt-1"
|
|
/>
|
|
<Label htmlFor="accommodation" className="cursor-pointer">
|
|
<div className="font-medium">Accommodation (Optional)</div>
|
|
<div className="text-sm text-muted-foreground">6 nights dorm at Commons Hub (€39.20/night)</div>
|
|
<div className="text-xs text-muted-foreground mt-1">
|
|
Double rooms available at €50.20/night per person
|
|
</div>
|
|
</Label>
|
|
</div>
|
|
<span className="text-lg font-semibold">€{accommodationPrice.toFixed(2)}</span>
|
|
</div>
|
|
|
|
{/* Food */}
|
|
<div className="flex items-start justify-between py-4 border-b border-border">
|
|
<div className="flex items-start gap-3">
|
|
<Checkbox
|
|
id="food"
|
|
checked={packages.food}
|
|
onCheckedChange={(checked) => setPackages({ ...packages, food: checked as boolean })}
|
|
className="mt-1"
|
|
/>
|
|
<Label htmlFor="food" className="cursor-pointer">
|
|
<div className="font-medium">Food Package (Optional)</div>
|
|
<div className="text-sm text-muted-foreground">6 days: vegetarian breakfast, lunch & dinner</div>
|
|
<div className="text-xs text-muted-foreground mt-1">
|
|
3 days catered (€35/day), 3 days self-organized (€10/day)
|
|
</div>
|
|
</Label>
|
|
</div>
|
|
<span className="text-lg font-semibold">€{foodPrice.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">
|
|
{packages.accommodation || packages.food
|
|
? "All selected items will be charged now"
|
|
: "Ticket only"}
|
|
</div>
|
|
</div>
|
|
<span className="text-2xl font-bold text-primary">€{calculateTotal().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="packages" value={JSON.stringify(packages)} />
|
|
|
|
<div className="space-y-4">
|
|
<div>
|
|
<Label className="text-base font-semibold mb-3 block">Select Payment Method</Label>
|
|
<RadioGroup name="paymentMethod" defaultValue="card" className="space-y-3">
|
|
<div className="flex items-center space-x-2 border rounded-lg p-4 hover:border-primary transition-colors">
|
|
<RadioGroupItem value="card" id="card" />
|
|
<Label htmlFor="card" className="flex-1 cursor-pointer">
|
|
<div className="font-medium">Credit Card</div>
|
|
<div className="text-sm text-muted-foreground">Visa, Mastercard, Amex</div>
|
|
</Label>
|
|
</div>
|
|
|
|
<div className="flex items-center space-x-2 border rounded-lg p-4 hover:border-primary transition-colors">
|
|
<RadioGroupItem value="sepa_debit" id="sepa" />
|
|
<Label htmlFor="sepa" className="flex-1 cursor-pointer">
|
|
<div className="font-medium">SEPA Bank Transfer</div>
|
|
<div className="text-sm text-muted-foreground">Direct debit from European banks</div>
|
|
</Label>
|
|
</div>
|
|
|
|
<div className="flex items-center space-x-2 border rounded-lg p-4 hover:border-primary transition-colors border-primary/30">
|
|
<RadioGroupItem value="crypto" id="crypto" />
|
|
<Label htmlFor="crypto" className="flex-1 cursor-pointer">
|
|
<div className="font-medium">Cryptocurrency</div>
|
|
<div className="text-sm text-muted-foreground">USDC Stablecoin (settles as EUR)</div>
|
|
</Label>
|
|
</div>
|
|
</RadioGroup>
|
|
</div>
|
|
|
|
<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 Stripe. You'll receive a confirmation email after successful
|
|
payment.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</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="/" className="text-2xl font-bold text-primary">
|
|
CCG
|
|
</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 CCG 2026</h1>
|
|
<p className="text-xl text-muted-foreground">August 16-22, 2026 at the Commons Hub in Austria</p>
|
|
</div>
|
|
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>Registration Form</CardTitle>
|
|
<CardDescription>Tell us about yourself and what you'd like to bring to CCG</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>
|
|
|
|
{/* 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 inputs do you want to contribute to CCG? *</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 organized as an unconference, meaning that each participant 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 CCG?</Label>
|
|
<Input
|
|
id="howHeard"
|
|
placeholder="First timers: Did anyone recommend it to you? (they might be rewarded!)"
|
|
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">
|
|
Food will involve catering as well as self-prepared meals. 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>
|
|
|
|
{/* Commons Crews Consent */}
|
|
<div className="space-y-3">
|
|
<Label>Commons Crews Participation *</Label>
|
|
<div className="bg-muted p-4 rounded-lg space-y-2 text-sm">
|
|
<p>
|
|
Part of the magic of CCG is that we consider the event a 'temporary commons' - we co-produce its
|
|
program as well as its leisure activities collectively.
|
|
</p>
|
|
<p>
|
|
This also involves joint care for the space and its maintenance needs, for emerging social and
|
|
emotional dynamics and for documentation of the sessions.
|
|
</p>
|
|
<p className="font-medium">
|
|
Besides active involvement in shaping the content of the event, you will be expected to contribute
|
|
to one or more 'commons crews' (kitchen, cleaning, documentation, facilitation, fire/water and
|
|
atmosphere).
|
|
</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 gimme work!
|
|
</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">
|
|
Continue to Payment
|
|
</Button>
|
|
</div>
|
|
|
|
<div className="text-sm text-muted-foreground text-center">
|
|
<p>
|
|
Questions? Contact us on{" "}
|
|
<a href="https://t.me/+Bc48A-mqvmY3MmE0" className="text-primary hover:underline">
|
|
Telegram
|
|
</a>
|
|
</p>
|
|
</div>
|
|
</form>
|
|
</CardContent>
|
|
</Card>
|
|
</main>
|
|
</div>
|
|
)
|
|
}
|