Archived
fix lint warnings
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useRef, useState, useEffect, useContext } from "react";
|
||||
import { useLocation, Link, useNavigate } from "react-router-dom";
|
||||
import { useState } from "react";
|
||||
import { useLocation, useNavigate } from "react-router-dom";
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import Container from "@mui/material/Container";
|
||||
import TextField from "@mui/material/TextField";
|
||||
@@ -10,7 +10,6 @@ import LoginIcon from "@mui/icons-material/Login";
|
||||
import useAuth from "../../hooks/useAuth";
|
||||
|
||||
const Login: React.FC = () => {
|
||||
|
||||
const { setAuth }: any = useAuth();
|
||||
|
||||
const navigate = useNavigate();
|
||||
@@ -34,8 +33,8 @@ const Login: React.FC = () => {
|
||||
|
||||
const handleLogin = () => {
|
||||
if (username === "" && password === "") {
|
||||
setAuth({username: username, isLoggedIn: true});
|
||||
navigate(from, {replace: true});
|
||||
setAuth({ username: username, isLoggedIn: true });
|
||||
navigate(from, { replace: true });
|
||||
}
|
||||
setUsername("");
|
||||
setPassword("");
|
||||
@@ -44,25 +43,52 @@ const Login: React.FC = () => {
|
||||
return (
|
||||
<Container className="login">
|
||||
<Stack className="grid-container" spacing={2}>
|
||||
<img className="login-logo" src={hsbcLogo} alt="HSBC Logo"/>
|
||||
<img className="login-logo" src={hsbcLogo} alt="HSBC Logo" />
|
||||
{/* <p ref={errRef} className={errMsg ? "errmsg" : "offscreen"} aria-live="assertive">{errMsg}</p> */}
|
||||
<TextField className="username-input" id="outlined-basic" label="Username" variant="outlined" placeholder="Username" onChange={(event) => {setUsername(event.target.value)}}/>
|
||||
<TextField className="password-input" id="outlined-basic" label="Password" variant="outlined" placeholder="Password" type="password" onChange={(event) => {setPassword(event.target.value)}}/>
|
||||
<TextField
|
||||
className="username-input"
|
||||
id="outlined-basic"
|
||||
label="Username"
|
||||
variant="outlined"
|
||||
placeholder="Username"
|
||||
onChange={(event) => {
|
||||
setUsername(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
className="password-input"
|
||||
id="outlined-basic"
|
||||
label="Password"
|
||||
variant="outlined"
|
||||
placeholder="Password"
|
||||
type="password"
|
||||
onChange={(event) => {
|
||||
setPassword(event.target.value);
|
||||
}}
|
||||
/>
|
||||
<Stack direction="row" justifyContent="space-between" spacing={2}>
|
||||
<a className="register-btn" href="#">
|
||||
<Typography sx={{ ml: 1, mb: 1 }}>Forgot your password?</Typography>
|
||||
</a>
|
||||
<Button endIcon={<LoginIcon />} className="login-btn" variant="contained" type="submit" onClick={handleLogin}>Login</Button>
|
||||
<Button
|
||||
endIcon={<LoginIcon />}
|
||||
className="login-btn"
|
||||
variant="contained"
|
||||
type="submit"
|
||||
onClick={handleLogin}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
</Stack>
|
||||
<Stack direction="row" justifyContent="space-between" spacing={2}>
|
||||
<Typography sx={{ ml: 1 }}>Login with</Typography>
|
||||
<a className="zoom-logo" href="#">
|
||||
<img src={zoomLogo} alt="Zoom Logo"/>
|
||||
<img src={zoomLogo} alt="Zoom Logo" />
|
||||
</a>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
export default Login;
|
||||
|
||||
export default Login;
|
||||
|
||||
Reference in New Issue
Block a user