import { createSignal, Show } from "solid-js"; import { useWellKnown } from "../../stores/wellKnown.tsx"; export default function RegisterPage() { const [title, setTitle] = createSignal("Create an account"); const [subtitle, setSubtitle] = createSignal("The first step to join our community."); const [error, setError] = createSignal(null); const [loading, setLoading] = createSignal(false); const [done, setDone] = createSignal(false); const metadata = useWellKnown(); async function submit(evt: SubmitEvent) { evt.preventDefault(); const data = Object.fromEntries(new FormData(evt.target as HTMLFormElement)); if (!data.name || !data.nick || !data.email || !data.password) return; setLoading(true); const res = await fetch("/api/users", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(data) }); if (res.status !== 200) { setError(await res.text()); } else { setError(null); setTitle("Congratulations!"); setSubtitle("Your account has been created and activation email has sent to your inbox!"); setDone(true); } setLoading(false); } return (

What's next?

Go login{" "} then you can take part in the entire smartsheep community.
); }