Merge pull request #74 from CPSC319-Winter-term-2/login

changed login styles
This commit is contained in:
Jincheng Lu 2022-03-30 23:45:52 -07:00 committed by GitHub
commit 53bf9199ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import Container from "@mui/material/Container";
import TextField from "@mui/material/TextField";
import Button from "@mui/material/Button";
import hsbcLogo from "../../assets/logo-png.png";
import zoomLogo from "../../assets/zoom.png";
import LoginIcon from "@mui/icons-material/Login";
import useAuth from "../../hooks/useAuth";
import axios from "../../api/axios";
@ -30,6 +29,7 @@ const Login: React.FC = () => {
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const [hasError, setHasError] = useState(false);
// const [errMsg, setErrMsg] = useState('');
// const userRef = useRef();
@ -73,6 +73,7 @@ const Login: React.FC = () => {
if (logedInUserId != undefined) {
setAuth["uuid"] = logedInUserId;
setAuth["isLoggedIn"] = true;
setHasError(false);
store.dispatch(fetchMeetings(logedInUserId));
store.dispatch(fetchUsers(logedInUserId));
store.dispatch(fetchFavorites(logedInUserId));
@ -81,6 +82,7 @@ const Login: React.FC = () => {
}
} catch (error) {
console.log(error);
setHasError(true);
}
setEmail(email);
setPassword("");
@ -109,6 +111,8 @@ const Login: React.FC = () => {
variant="outlined"
value={password}
placeholder="Password"
error={hasError}
helperText={hasError ? "Email or Password Incorrect!" : ""}
type="password"
onChange={(event) => {
setPassword(event.target.value);

View File

@ -78,7 +78,7 @@ const Body: React.FC<Props> = ({ meeting }) => {
hourMod +
":" +
// isoTime.slice(3, 5) +
date.getMinutes() +
(date.getMinutes() < 10 ? "0" + date.getMinutes() : "" + date.getMinutes()) +
(hour > 11 ? "PM" : "AM")
);
};