From 0044b61ac8233c1309a446542d46e71a2358000d Mon Sep 17 00:00:00 2001 From: Peter KW Date: Mon, 18 Mar 2024 00:44:11 +0100 Subject: [PATCH] Uses input field component instead now --- frontend/src/Components/Register.tsx | 31 +++------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/frontend/src/Components/Register.tsx b/frontend/src/Components/Register.tsx index 0c0fcd0..3b17890 100644 --- a/frontend/src/Components/Register.tsx +++ b/frontend/src/Components/Register.tsx @@ -1,41 +1,16 @@ import { useState } from "react"; -import { NewUser } from "../Types/Users"; +import { NewUser } from "../Types/goTypes"; import { api } from "../API/API"; import Logo from "../assets/Logo.svg"; import Button from "./Button"; - -function InputField(props: { - label: string; - type: string; - value: string; - onChange: (e: React.ChangeEvent) => void; -}): JSX.Element { - return ( -
- - -
- ); -} +import InputField from "./InputField"; export default function Register(): JSX.Element { const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); const handleRegister = async (): Promise => { - const newUser: NewUser = { userName: username, password }; + const newUser: NewUser = { username: username, password }; await api.registerUser(newUser); // TODO: Handle errors };