Design UI of Login page

parent 6b4f15a0
import React, { useEffect, useState } from "react";
import { Link, useHistory } from "react-router-dom";
import { auth, signInWithEmailAndPassword, signInWithGoogle } from "./firebase";
import { useAuthState } from "react-firebase-hooks/auth";
import "./style.css"
import logo from './images/login.jpg';
function Login() {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [user, loading, error] = useAuthState(auth);
const history = useHistory();
useEffect(() => {
if (loading) {
// maybe trigger a loading screen
return;
}
if (user) history.replace("/Home");
}, [user, loading]);
return (
<div className="login">
<div className="login__container">
<img
src={logo}
className='img-fluid shadow-2-strong'
alt=''
style={{ maxWidth: '24rem', paddingBottom: '25px', paddingLeft: '5px', paddingRight: '5px', paddingTop: '5px' }}
/>
<h1 className="register__title">Login</h1>
<input
type="text"
className="login__textBox"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="E-mail Address"
/>
<input
type="password"
className="login__textBox"
value={password}
onChange={(e) => setPassword(e.target.value)}
placeholder="Password"
/>
<button
className="login__btn"
onClick={() => signInWithEmailAndPassword(email, password)}
>
Login
</button>
<div className="login__btn login__google">
<span class="input-group-addon"><i class="fa fa-google" style={{ paddingBottom: '0px', paddingLeft: '5px', paddingRight: '15px', paddingTop: '0px' }}></i></span>
<button className="login__btn login__google" onClick={signInWithGoogle}>
Login with Google
</button>
</div>
<div>
<Link to="/reset">Forgot Password</Link>
</div>
<div>
Not registered yet? <Link to="/register">Register</Link> now.
</div>
</div>
</div>
);
}
export default Login;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment