diff --git a/app/ui/components/registration-form.tsx b/app/ui/components/registration-form.tsx index 5c4fb71..3c7b5d7 100644 --- a/app/ui/components/registration-form.tsx +++ b/app/ui/components/registration-form.tsx @@ -11,6 +11,7 @@ import { register } from '@/app/api/authentication'; import { getCaptchaChallenge } from '@/app/api/captcha'; export default function RegistrationForm() { + const [submitted, setSubmitted] = useState(false); const [errors, setErrors] = useState([]); const [email, setEmail] = useState(""); @@ -36,54 +37,62 @@ export default function RegistrationForm() { useEffect(refreshCaptcha, []) return ( -
- - setEmail(e.target.value)} /> - - - - setPassword(e.target.value)} /> - - - - setPasswordConfirmation(e.target.value)} /> - - - - setSlug(e.target.value)} /> - - - captcha - - setCaptchaAnswer(e.target.value)} /> - - + submitted ? ( +
+
Registration successful. Check your email for a confirmation link.
+
+ ) : ( - {errors.map((error, index) => ( -
{error}
- ))} +
+ + setEmail(e.target.value)} /> + + + + setPassword(e.target.value)} /> + + + + setPasswordConfirmation(e.target.value)} /> + + + + setSlug(e.target.value)} /> + + + captcha + + setCaptchaAnswer(e.target.value)} /> + + + + {errors.map((error, index) => ( +
{error}
+ ))} - -
+ +
+ ) + ); } \ No newline at end of file