From f3c563996111916b0269d9091a012740d247737b Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Mon, 19 Sep 2022 18:35:22 -0400 Subject: [PATCH] a much better registration/failure model (#50) --- ui/src/Register.js | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/ui/src/Register.js b/ui/src/Register.js index 20a887ec..ecdf5533 100644 --- a/ui/src/Register.js +++ b/ui/src/Register.js @@ -3,17 +3,37 @@ import {useEffect, useState} from "react"; import * as identity from "./api/identity"; const Proceed = (props) => { + const [password, setPassword] = useState(''); + const [confirm, setConfirm] = useState(''); + + const handleSubmit = async e => { + e.preventDefault(); + console.log("submit", password, confirm) + } + return ( -
-

Register a new zrok account!

-

{props.email}

+
+ +

A new zrok user!

+

{props.email}

+
+
+ Set A Password +

setPassword(target.value)}/>

+

+ setConfirm(target.value)}/> + +

+
+
) } const Failed = () => { return ( -
+
+

No such account request!

) @@ -27,7 +47,6 @@ const Register = () => { useEffect(() => { let mounted = true identity.verify({body: {token: token}}).then(resp => { - console.log("resp", resp) if(mounted) { if(resp.error) { setFailed(true); @@ -54,17 +73,7 @@ const Register = () => { } return ( -
-
-
- {"ziggy -

zrok

-
-
- {step} -
-
-
+
{step}
) }