Login Function added
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import {useState} from "react";
|
||||
import Button from "@/components/Button";
|
||||
|
||||
export default function Login() {
|
||||
|
||||
let url = "http://localhost:8080/users"
|
||||
|
||||
function on_login_click()
|
||||
{
|
||||
url += "?mail=" + inputUserName + "&password=" + inputPassword;
|
||||
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
}).then(r => console.log())
|
||||
}
|
||||
|
||||
const [inputUserName, setInputUserName] = useState("")
|
||||
const [inputPassword, setInputPassword] = useState("")
|
||||
|
||||
return (
|
||||
<div className="border">
|
||||
<login className={"login-container"}>
|
||||
<p className={"font-big-fat placement"}>Login</p>
|
||||
<div className={"placement"}>
|
||||
<br/>
|
||||
<p className={"font-kinda-big"}>Username</p>
|
||||
<input type="text" value={inputUserName} onChange={e => setInputUserName(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/>
|
||||
<br/>
|
||||
<p className={"font-kinda-big"}>Password</p>
|
||||
<input type="password" value={inputPassword} onChange={e => setInputPassword(e.target.value)} placeholder="Type here" className="input input-bordered input-sm w-full max-w-xs"/>
|
||||
</div>
|
||||
<Button text={"Login"} color={"#e2001a"} width={"25px"} onClick={() => on_login_click()}/>
|
||||
</login>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user