doc: add useState, onChange, and signIn methods to login
This commit is contained in:
1 parent
e942f0a5c2
commit
a18db46151
1 file changed
+18
-4
+18
-4
@@ -1,8 +1,12 @@
|
|||||||
import React from "react";
|
import React, { useState } from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import "./Login.css";
|
import "./Login.css";
|
||||||
|
|
||||||
function Login() {
|
function Login() {
|
||||||
|
const [email, setEmail] = useState("");
|
||||||
|
const [password, setPassword] = useState("");
|
||||||
|
|
||||||
|
const signIn = () => {};
|
||||||
return (
|
return (
|
||||||
<section className="login">
|
<section className="login">
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
@@ -17,11 +21,21 @@ function Login() {
|
|||||||
<h1>Sign In</h1>
|
<h1>Sign In</h1>
|
||||||
<form>
|
<form>
|
||||||
<h5>Email</h5>
|
<h5>Email</h5>
|
||||||
<input type="email" />
|
<input
|
||||||
|
type="email"
|
||||||
|
value={email}
|
||||||
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
|
/>
|
||||||
<h5>Password</h5>
|
<h5>Password</h5>
|
||||||
<input type="password" />
|
<input
|
||||||
|
type="password"
|
||||||
|
value={password}
|
||||||
|
onChange={(e) => setPassword(e.target.value)}
|
||||||
|
/>
|
||||||
|
|
||||||
<button className="login__signInButton">Sign In</button>
|
<button className="login__signInButton" onClick={signIn}>
|
||||||
|
Sign In
|
||||||
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in new issue
Block a user