Merge pull request #74 from CPSC319-Winter-term-2/login
changed login styles
This commit is contained in:
commit
53bf9199ea
@ -5,7 +5,6 @@ import Container from "@mui/material/Container";
|
|||||||
import TextField from "@mui/material/TextField";
|
import TextField from "@mui/material/TextField";
|
||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import hsbcLogo from "../../assets/logo-png.png";
|
import hsbcLogo from "../../assets/logo-png.png";
|
||||||
import zoomLogo from "../../assets/zoom.png";
|
|
||||||
import LoginIcon from "@mui/icons-material/Login";
|
import LoginIcon from "@mui/icons-material/Login";
|
||||||
import useAuth from "../../hooks/useAuth";
|
import useAuth from "../../hooks/useAuth";
|
||||||
import axios from "../../api/axios";
|
import axios from "../../api/axios";
|
||||||
@ -30,6 +29,7 @@ const Login: React.FC = () => {
|
|||||||
|
|
||||||
const [email, setEmail] = useState("");
|
const [email, setEmail] = useState("");
|
||||||
const [password, setPassword] = useState("");
|
const [password, setPassword] = useState("");
|
||||||
|
const [hasError, setHasError] = useState(false);
|
||||||
// const [errMsg, setErrMsg] = useState('');
|
// const [errMsg, setErrMsg] = useState('');
|
||||||
|
|
||||||
// const userRef = useRef();
|
// const userRef = useRef();
|
||||||
@ -73,6 +73,7 @@ const Login: React.FC = () => {
|
|||||||
if (logedInUserId != undefined) {
|
if (logedInUserId != undefined) {
|
||||||
setAuth["uuid"] = logedInUserId;
|
setAuth["uuid"] = logedInUserId;
|
||||||
setAuth["isLoggedIn"] = true;
|
setAuth["isLoggedIn"] = true;
|
||||||
|
setHasError(false);
|
||||||
store.dispatch(fetchMeetings(logedInUserId));
|
store.dispatch(fetchMeetings(logedInUserId));
|
||||||
store.dispatch(fetchUsers(logedInUserId));
|
store.dispatch(fetchUsers(logedInUserId));
|
||||||
store.dispatch(fetchFavorites(logedInUserId));
|
store.dispatch(fetchFavorites(logedInUserId));
|
||||||
@ -81,6 +82,7 @@ const Login: React.FC = () => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
setHasError(true);
|
||||||
}
|
}
|
||||||
setEmail(email);
|
setEmail(email);
|
||||||
setPassword("");
|
setPassword("");
|
||||||
@ -109,6 +111,8 @@ const Login: React.FC = () => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
value={password}
|
value={password}
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
|
error={hasError}
|
||||||
|
helperText={hasError ? "Email or Password Incorrect!" : ""}
|
||||||
type="password"
|
type="password"
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
setPassword(event.target.value);
|
setPassword(event.target.value);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ const Body: React.FC<Props> = ({ meeting }) => {
|
|||||||
hourMod +
|
hourMod +
|
||||||
":" +
|
":" +
|
||||||
// isoTime.slice(3, 5) +
|
// isoTime.slice(3, 5) +
|
||||||
date.getMinutes() +
|
(date.getMinutes() < 10 ? "0" + date.getMinutes() : "" + date.getMinutes()) +
|
||||||
(hour > 11 ? "PM" : "AM")
|
(hour > 11 ? "PM" : "AM")
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user