replaced email with username

This commit is contained in:
Daniel
2023-07-08 14:05:43 +03:30
parent 3993615071
commit 97ca682c0a
32 changed files with 283 additions and 117 deletions
+7 -7
View File
@@ -6,7 +6,7 @@ import SubmitButton from "@/components/SubmitButton";
interface FormData {
name: string;
email: string;
username: string;
password: string;
passwordConfirmation: string;
}
@@ -18,7 +18,7 @@ export default function Register() {
const [form, setForm] = useState<FormData>({
name: "",
email: "",
username: "",
password: "",
passwordConfirmation: "",
});
@@ -26,7 +26,7 @@ export default function Register() {
async function registerUser() {
if (
form.name !== "" &&
form.email !== "" &&
form.username !== "" &&
form.password !== "" &&
form.passwordConfirmation !== ""
) {
@@ -54,7 +54,7 @@ export default function Register() {
if (response.ok) {
setForm({
name: "",
email: "",
username: "",
password: "",
passwordConfirmation: "",
});
@@ -96,13 +96,13 @@ export default function Register() {
className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
/>
<p className="text-sm text-sky-500 w-fit font-semibold">Email</p>
<p className="text-sm text-sky-500 w-fit font-semibold">Username</p>
<input
type="text"
placeholder="johnny@example.com"
value={form.email}
onChange={(e) => setForm({ ...form, email: e.target.value })}
value={form.username}
onChange={(e) => setForm({ ...form, username: e.target.value })}
className="w-full rounded-md p-3 mx-auto border-sky-100 border-solid border outline-none focus:border-sky-500 duration-100"
/>