sovereign-intelligence
Front door to Drake Stapleton's sovereign stack.
Brought by drakestapleton
sovereign-intelligence / docs / archive / drakestapleton.com-old / src / pages / WaitlistPage.tsx
| 1 | import { FormEvent, useMemo, useState } from "react"; |
| 2 | import { usePageMeta } from "../lib/usePageMeta"; |
| 3 | |
| 4 | const WAITLIST_ENDPOINT = |
| 5 | import.meta.env.VITE_WAITLIST_ENDPOINT || |
| 6 | "https://waitlist-api.drakestapleton.com:8443/api/signup"; |
| 7 | |
| 8 | type FormState = "idle" | "submitting" | "success" | "error"; |
| 9 | |
| 10 | export function WaitlistPage() { |
| 11 | usePageMeta({ |
| 12 | title: "Drake Stapleton | A Life in People, Science, and Systems", |
| 13 | description: |
| 14 | "A human portrait and body of work by Drake Stapleton is in development. Join the waiting list for the first public release.", |
| 15 | path: "/", |
| 16 | }); |
| 17 | |
| 18 | const openedAt = useMemo(() => Date.now(), []); |
| 19 | const [state, setState] = useState<FormState>("idle"); |
| 20 | const [message, setMessage] = useState(""); |
| 21 | |
| 22 | async function joinWaitlist(event: FormEvent<HTMLFormElement>) { |
| 23 | event.preventDefault(); |
| 24 | const formElement = event.currentTarget; |
| 25 | const form = new FormData(formElement); |
| 26 | const email = String(form.get("email") || "").trim(); |
| 27 | const consent = form.get("consent") === "on"; |
| 28 | const website = String(form.get("website") || ""); |
| 29 | |
| 30 | if (!email || !consent) { |
| 31 | setState("error"); |
| 32 | setMessage("Enter your email and confirm how it will be used."); |
| 33 | return; |
| 34 | } |
| 35 | |
| 36 | setState("submitting"); |
| 37 | setMessage(""); |
| 38 | |
| 39 | try { |
| 40 | const response = await fetch(WAITLIST_ENDPOINT, { |
| 41 | method: "POST", |
| 42 | headers: { "Content-Type": "application/json" }, |
| 43 | body: JSON.stringify({ |
| 44 | email, |
| 45 | consent, |
| 46 | consentVersion: "2026-08-13-v1", |
| 47 | website, |
| 48 | elapsedMs: Date.now() - openedAt, |
| 49 | }), |
| 50 | }); |
| 51 | |
| 52 | if (!response.ok) { |
| 53 | throw new Error(`waitlist request failed with ${response.status}`); |
| 54 | } |
| 55 | |
| 56 | setState("success"); |
| 57 | setMessage("You are on the list. I will write when the first public release is ready."); |
| 58 | formElement.reset(); |
| 59 | } catch { |
| 60 | setState("error"); |
| 61 | setMessage("Please try again in a moment so I can add your email."); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | return ( |
| 66 | <main className="waitlist-shell"> |
| 67 | <section className="waitlist-copy"> |
| 68 | <p className="waitlist-kicker">Drake Stapleton / Thirty-two years alive</p> |
| 69 | <h1> |
| 70 | A life in <span className="waitlist-keep">people, science,</span>{" "} |
| 71 | <span className="waitlist-keep">and <em>systems.</em></span> |
| 72 | </h1> |
| 73 | <p className="waitlist-lede"> |
| 74 | I am writing the full story now: Tennessee, Kentucky, family, chemistry, manufacturing, |
| 75 | communities, independent projects, and the determination that carried me through every hard turn. |
| 76 | </p> |
| 77 | <p className="waitlist-rule">The work is technical. The reason is human.</p> |
| 78 | </section> |
| 79 | |
| 80 | <aside className="waitlist-panel" aria-labelledby="waitlist-title"> |
| 81 | <p className="waitlist-number">Private development / 2026</p> |
| 82 | <h2 id="waitlist-title">Join the waiting list.</h2> |
| 83 | <p> |
| 84 | I am finishing the record and telling it in my own voice. Leave one email and I will write when |
| 85 | the complete portrait opens. |
| 86 | </p> |
| 87 | |
| 88 | {state === "success" ? ( |
| 89 | <div className="waitlist-success" role="status"> |
| 90 | <span>Received</span> |
| 91 | <p>{message}</p> |
| 92 | </div> |
| 93 | ) : ( |
| 94 | <form className="waitlist-form" onSubmit={joinWaitlist}> |
| 95 | <label htmlFor="email">Email address</label> |
| 96 | <input |
| 97 | id="email" |
| 98 | name="email" |
| 99 | type="email" |
| 100 | inputMode="email" |
| 101 | autoComplete="email" |
| 102 | maxLength={254} |
| 103 | required |
| 104 | disabled={state === "submitting"} |
| 105 | /> |
| 106 | <div className="waitlist-honeypot" aria-hidden="true"> |
| 107 | <label htmlFor="website">Website</label> |
| 108 | <input id="website" name="website" type="text" tabIndex={-1} autoComplete="off" /> |
| 109 | </div> |
| 110 | <label className="waitlist-consent"> |
| 111 | <input name="consent" type="checkbox" required disabled={state === "submitting"} /> |
| 112 | <span> |
| 113 | Use my email solely for the announcement that this portfolio is open. My address stays |
| 114 | private and leaves the list whenever I ask. |
| 115 | </span> |
| 116 | </label> |
| 117 | <button type="submit" disabled={state === "submitting"}> |
| 118 | {state === "submitting" ? "Joining..." : "Join the list"} |
| 119 | </button> |
| 120 | {message ? ( |
| 121 | <p className="waitlist-message" role="alert"> |
| 122 | {message} |
| 123 | </p> |
| 124 | ) : null} |
| 125 | </form> |
| 126 | )} |
| 127 | |
| 128 | <p className="waitlist-privacy"> |
| 129 | Stored with consent: email address, consent version, and signup time. Your address supports this |
| 130 | single announcement and stays private. |
| 131 | </p> |
| 132 | </aside> |
| 133 | |
| 134 | <footer className="waitlist-footer"> |
| 135 | <span>Drake Stapleton</span> |
| 136 | <span>Springfield, Missouri</span> |
| 137 | </footer> |
| 138 | </main> |
| 139 | ); |
| 140 | } |