diff --git a/app/api/beta-signup/route.ts b/app/api/beta-signup/route.ts index fcf0a1b..cd940ea 100644 --- a/app/api/beta-signup/route.ts +++ b/app/api/beta-signup/route.ts @@ -11,6 +11,7 @@ export async function POST(req: Request) { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), + cache: "no-store", }); // Always return ok=true (matches your server behavior) diff --git a/app/page.tsx b/app/page.tsx index be03d45..0e71ffe 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -13,6 +13,7 @@ export default function HomePage() { async function handleSubmit(e: FormEvent) { e.preventDefault(); + if (!email) { setMessage("Drop an email in first, operator."); setStatus("error"); @@ -30,11 +31,12 @@ export default function HomePage() { }); if (!res.ok) { - throw new Error("Failed to save your signup."); + const txt = await res.text().catch(() => ""); + throw new Error(txt || "Failed to save your signup."); } setStatus("success"); - setMessage("You’re locked in. Watch your inbox."); + setMessage("✅ You’re on the list. Invites drop soon — we’ll email your access link when it’s go-time."); setEmail(""); setUseCase(""); } catch (err) { @@ -160,7 +162,8 @@ export default function HomePage() { value={email} onChange={(e) => setEmail(e.target.value)} placeholder="you@gearjunkie.com" - className="mt-1 w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-50 outline-none ring-amber-500/30 placeholder:text-zinc-600 focus:border-amber-400/80 focus:ring-2" + disabled={status === "loading" || status === "success"} + className="mt-1 w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-50 outline-none ring-amber-500/30 placeholder:text-zinc-600 focus:border-amber-400/80 focus:ring-2 disabled:opacity-60 disabled:cursor-not-allowed" required /> @@ -178,17 +181,22 @@ export default function HomePage() { value={useCase} onChange={(e) => setUseCase(e.target.value)} rows={3} + disabled={status === "loading" || status === "success"} placeholder="E.g. Comparing build costs, finding the best deals, sharing my builds, weird influencer shit..." - className="mt-1 w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-xs text-zinc-50 outline-none ring-amber-500/30 placeholder:text-zinc-600 focus:border-amber-400/80 focus:ring-2" + className="mt-1 w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-xs text-zinc-50 outline-none ring-amber-500/30 placeholder:text-zinc-600 focus:border-amber-400/80 focus:ring-2 disabled:opacity-60 disabled:cursor-not-allowed" /> {message && ( @@ -205,6 +213,19 @@ export default function HomePage() {
)} + {status === "success" && ( + + )} +